From: j8takagi Date: Tue, 23 Jul 2013 14:18:34 +0000 (+0900) Subject: Makefileの推敲 X-Git-Tag: v0.2p15 X-Git-Url: https://j8takagi.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd95f4b23c44e0164e06751b491797dc72545b27;p=YACASL2.git Makefileの推敲 --- diff --git a/Makefile b/Makefile index d85cacc..ca55acb 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ VERSIONFILES = include/package.h test/system/casl2/opt_v/0.txt test/system/comet all: build doc gtags -build: version +build: $(MAKE) -C src all $(CP) $(addprefix src/,$(CMD)) ./ diff --git a/VERSION b/VERSION index 00f3850..c43e157 100644 --- a/VERSION +++ b/VERSION @@ -1 +1,2 @@ -v0.2p13 +v0.2p15 + diff --git a/src/Makefile b/src/Makefile index 5aca7be..59e1189 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,3 +1,4 @@ +# ヘッダファイルの場所 INCLUDEDIR := ../include INCLUDE = -I $(INCLUDEDIR) @@ -31,8 +32,13 @@ comet2: comet2.o $(addsuffix .o,$(COMMONOBJ) $(CASL2OBJ) $(EXECOBJ)) dumpword: dumpword.o $(addsuffix .o,$(COMMONOBJ)) # .dファイルからヘッダファイルの依存関係を取得する -# tags、check、cleanで終わるターゲットの場合は除く -ifeq (,$(strip $(filter %tags,$(MAKECMDGOALS)) $(filter %check,$(MAKECMDGOALS)) $(filter %clean,$(MAKECMDGOALS)))) +# tags、check、clean、.d で終わるターゲットの場合は除く +ifeq (,$(strip \ + $(filter %tags,$(MAKECMDGOALS)) \ + $(filter %check,$(MAKECMDGOALS)) \ + $(filter %clean,$(MAKECMDGOALS)) \ + $(filter %.d,$(MAKECMDGOALS))\ +)) -include $(addsuffix .d,$(CMDOBJ) $(COMMONOBJ) $(CASL2OBJ) $(ASOBJ) $(EXECOBJ)) endif @@ -48,14 +54,17 @@ TAGS: $(INCLUDEDIR)/*.h *.c # makeで生成したファイルの削除 distclean: clean - @$(RM) casl2 comet2 dumpword + $(RM) casl2 comet2 dumpword clean: tag-clean - @$(RM) *.o *.d + $(RM) *.o *.d tag-clean: - @$(RM) TAGS tags + $(RM) TAGS tags # ヘッダファイルの依存関係を.dファイルに出力する -%.d: %.c +%.d: %.c $(INCLUDEDIR)/package.h $(CC) -MM -I $(INCLUDEDIR) $< | $(SED) 's,$*\.o *:,$*.o $*.d:,g' >$@ + +$(INCLUDEDIR)/package.h: ../VERSION + $(MAKE) -C .. version