From: Daniel Carl Date: Sat, 14 Apr 2018 19:17:42 +0000 (+0200) Subject: Do not use to many variables in makefiles. X-Git-Url: https://git.owens.tech/about.html/about.html/git?a=commitdiff_plain;h=366abadbd1ddecbc20891377911c86c77975594c;p=vimb.git Do not use to many variables in makefiles. --- diff --git a/Makefile b/Makefile index dd9aa53..5bbd7ca 100644 --- 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 diff --git a/src/Makefile b/src/Makefile index 683b9b1..a22d7a6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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 diff --git a/src/webextension/Makefile b/src/webextension/Makefile index 72c12df..91de2f5 100644 --- a/src/webextension/Makefile +++ b/src/webextension/Makefile @@ -1,5 +1,4 @@ -BASEDIR=../.. -include $(BASEDIR)/config.mk +include ../../config.mk OBJ = $(patsubst %.c, %.lo, $(wildcard *.c))