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; \
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