From: j8takagi Date: Sun, 5 Dec 2010 15:11:43 +0000 (+0900) Subject: Makefileの修正 X-Git-Tag: v0.1p15~18 X-Git-Url: http://j8takagi.net/cgi-bin/gitweb.cgi?p=YACASL2.git;a=commitdiff_plain;h=de52e6f779e8682236319dd36180f1ab58ffeed9 Makefileの修正 --- diff --git a/Makefile b/Makefile index c5e491e..8066daa 100644 --- a/Makefile +++ b/Makefile @@ -2,25 +2,30 @@ ifndef prefix prefix = $(HOME) endif CLEANDIR = src test/integration test/unit as/casl2lib -.PHPNY: all build clean check doc casl2lib install uninstall -all: build casl2lib +.PHONY: all build clean check doc install uninstall + +all: build + build: make -C src -casl2lib: - @make -C as/casl2lib + check: @make -sC test/integration + doc: @make -sC doc + clean: @for target in $(CLEANDIR); do $(MAKE) -sC $$target clean; done; \ rm -f casl2 comet2 dumpword + install: all @if test -d $(prefix); then \ install -s ./casl2 $(prefix)/casl2; \ install -s ./comet2 $(prefix)/comet2; \ install -s ./dumpword $(prefix)/dumpword; \ fi + uninstall: @if test -d $(prefix); then \ rm -f $(prefix)/casl2 $(prefix)/comet2 $(prefix)/dumpword; \ diff --git a/src/Makefile b/src/Makefile index e28e81d..48254ab 100644 --- a/src/Makefile +++ b/src/Makefile @@ -7,20 +7,31 @@ WORDSRC = word.o COMMONSRC = $(WORDSRC) $(HASHSRC) $(CERRSRC) struct.o cmd.o ASSRC = assemble.o token.o label.o macro.o EXECSRC = exec.o dump.o -.PHPNY: all clean -all: ../casl2 ../comet2 ../dumpword TAGS + +.PHONY: all clean + +all: ../casl2 ../comet2 ../dumpword + ../casl2: casl2.o $(COMMONSRC) $(ASSRC) $(EXECSRC) $(CC) $(CFLAGS) -o $@ $^ + ../comet2: comet2.o $(COMMONSRC) $(EXECSRC) $(CC) $(CFLAGS) -o $@ $^ + ../dumpword: dumpword.o $(WORDSRC) $(CERRSRC) $(CC) $(CFLAGS) -o $@ $^ + %.o: %.c $(CC) -c $(CFLAGS) $< + casl2.o comet2.o $(COMMONSRC) $(ASSRC) $(EXECSRC): $(INCLUDE)/casl2.h $(INCLUDE)/word.h $(INCLUDE)/hash.h $(INCLUDE)/cerr.h + casl2.o $(ASSRC): $(INCLUDE)/assemble.h + comet2.o $(EXECSRC): $(INCLUDE)/exec.h + TAGS: $(INCLUDE)/*.h *.c @if test `which etags`; then etags $^; fi + clean: @rm -f *.o