From fd95f4b23c44e0164e06751b491797dc72545b27 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Tue, 23 Jul 2013 23:18:34 +0900 Subject: [PATCH 1/1] =?utf8?q?Makefile=E3=81=AE=E6=8E=A8=E6=95=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- VERSION | 3 ++- src/Makefile | 21 +++++++++++++++------ 3 files changed, 18 insertions(+), 8 deletions(-) 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 -- 2.18.0