Do not use to many variables in makefiles.
authorDaniel Carl <danielcarl@gmx.de>
Sat, 14 Apr 2018 19:17:42 +0000 (21:17 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Sat, 14 Apr 2018 19:17:42 +0000 (21:17 +0200)
Makefile
src/Makefile
src/webextension/Makefile

index dd9aa53..5bbd7ca 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 include config.mk
 
-all: $(SRCDIR).subdir-all
+all: src.subdir-all
 
 options:
        @echo "vimb build options:"
@@ -10,13 +10,13 @@ options:
        @echo "EXTCFLAGS = $(EXTCFLAGS)"
        @echo "CC        = $(CC)"
 
-install: $(SRCDIR).subdir-all
+install: src.subdir-all
        @# binary
        install -d $(BINPREFIX)
-       install -m 755 $(SRCDIR)/vimb $(BINPREFIX)/vimb
+       install -m 755 src/vimb $(BINPREFIX)/vimb
        @# extension
        install -d $(LIBDIR)
-       install -m 644 $(SRCDIR)/webextension/$(EXTTARGET) $(LIBDIR)/$(EXTTARGET)
+       install -m 644 src/webextension/$(EXTTARGET) $(LIBDIR)/$(EXTTARGET)
        @# man page
        install -d $(MANPREFIX)/man1
        @sed -e "s!VERSION!$(VERSION)!g" \
@@ -32,7 +32,7 @@ uninstall:
        $(RM) $(LIBDIR)/$(EXTTARGET)
        $(RM) $(DOTDESKTOPPREFIX)/vimb.desktop
 
-clean: $(SRCDIR).subdir-clean
+clean: src.subdir-clean
 
 sandbox:
        $(Q)$(MAKE) RUNPREFIX=$(CURDIR)/sandbox/usr PREFIX=/usr DESTDIR=./sandbox install
index 683b9b1..a22d7a6 100644 (file)
@@ -1,21 +1,19 @@
-BASEDIR=..
-include $(BASEDIR)/config.mk
+include ../config.mk
 
-SUBDIRS  = webextension
 OBJ      = $(patsubst %.c, %.o, $(wildcard *.c))
 JSFILES  = $(wildcard scripts/*.js)
 CSSFILES = $(wildcard scripts/*.css)
 
-all: vimb $(SUBDIRS:%=%.subdir-all)
+all: vimb webextension.subdir-all
 
-clean: $(SUBDIRS:%=%.subdir-clean)
+clean: webextension.subdir-clean
        $(RM) vimb *.o scripts/scripts.h
 
 vimb: $(OBJ)
        @echo "${CC} $@"
        $(Q)$(CC) $(OBJ) $(LDFLAGS) -o $@
 
-$(OBJ): config.h $(BASEDIR)/config.mk
+$(OBJ): config.h ../config.mk
 
 normal.o: scripts/scripts.h
 
index 72c12df..91de2f5 100644 (file)
@@ -1,5 +1,4 @@
-BASEDIR=../..
-include $(BASEDIR)/config.mk
+include ../../config.mk
 
 OBJ = $(patsubst %.c, %.lo, $(wildcard *.c))