From: Daniel Carl Date: Sat, 14 Apr 2018 19:57:07 +0000 (+0200) Subject: Use separate makefile in for scripts. X-Git-Url: https://git.owens.tech/projects.html/projects.html/git?a=commitdiff_plain;h=aad01d935221bb7e58e5d0f01613ae1677016195;p=vimb.git Use separate makefile in for scripts. --- diff --git a/src/Makefile b/src/Makefile index a22d7a6..9c0ed2b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,13 +1,11 @@ include ../config.mk -OBJ = $(patsubst %.c, %.o, $(wildcard *.c)) -JSFILES = $(wildcard scripts/*.js) -CSSFILES = $(wildcard scripts/*.css) +OBJ = $(patsubst %.c, %.o, $(wildcard *.c)) all: vimb webextension.subdir-all clean: webextension.subdir-clean - $(RM) vimb *.o scripts/scripts.h + $(RM) vimb $(OBJ) vimb: $(OBJ) @echo "${CC} $@" @@ -19,19 +17,14 @@ normal.o: scripts/scripts.h setting.o: scripts/scripts.h +scripts/scripts.h: scripts.subdir-all + -include $(OBJ:.o=.d) config.h: @echo create $@ from config.def.h $(Q)cp config.def.h $@ -scripts/scripts.h: $(JSFILES) $(CSSFILES) - $(Q)$(RM) $@ - @echo "create $@ from *.{css,js}" - $(Q)for file in $(JSFILES) $(CSSFILES); do \ - ./scripts/js2h.sh $$file >> $@; \ - done - %.o: %.c @echo "${CC} $@" $(Q)$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< diff --git a/src/scripts/Makefile b/src/scripts/Makefile new file mode 100644 index 0000000..e28955e --- /dev/null +++ b/src/scripts/Makefile @@ -0,0 +1,18 @@ +include ../../config.mk + +JSFILES = $(wildcard *.js) +CSSFILES = $(wildcard *.css) + +all: scripts.h + +clean: + $(RM) scripts.h + +scripts.h: $(JSFILES) $(CSSFILES) + $(Q)$(RM) $@ + @echo "create $@ from *.{css,js}" + $(Q)for file in $(JSFILES) $(CSSFILES); do \ + ./js2h.sh $$file >> $@; \ + done + +.PHONY: all clean diff --git a/src/webextension/Makefile b/src/webextension/Makefile index 91de2f5..2f438b5 100644 --- a/src/webextension/Makefile +++ b/src/webextension/Makefile @@ -5,7 +5,7 @@ OBJ = $(patsubst %.c, %.lo, $(wildcard *.c)) all: $(EXTTARGET) clean: - $(RM) $(EXTTARGET) *.lo + $(RM) $(EXTTARGET) $($OBJ) $(EXTTARGET): $(OBJ) @echo "$(CC) $@"