cleaning up makefile stuff for ex22

This commit is contained in:
Dan Buch 2011-11-01 22:05:27 -04:00
parent f2110a5d13
commit 316ce7f8be
2 changed files with 13 additions and 6 deletions

View File

@ -3,13 +3,9 @@ CFLAGS=-Wall -g -DNDEBUG
EXERCISES = $(patsubst %.c,%,$(shell ls ex*.c | egrep -v "ex(19|22)")) EXERCISES = $(patsubst %.c,%,$(shell ls ex*.c | egrep -v "ex(19|22)"))
all: $(EXERCISES) ex22_main all: $(EXERCISES)
$(MAKE) -f ex19.mk $(MAKE) -f ex19.mk
$(MAKE) -f ex22.mk
ex22_main: ex22.c ex22_main.c ex22.h
$(CC) $(CFLAGS) -c -o ex22.o ex22.c
$(CC) $(CFLAGS) ex22_main.c ex22.o -o $@
test: all test: all
@ -19,6 +15,7 @@ test: all
clean: clean:
rm -f $(EXERCISES) rm -f $(EXERCISES)
$(MAKE) -f ex19.mk clean $(MAKE) -f ex19.mk clean
$(MAKE) -f ex22.mk clean
.PHONY: all test clean .PHONY: all test clean

10
ex22.mk Normal file
View File

@ -0,0 +1,10 @@
all: ex22_main
ex22_main: ex22_main.o ex22.o
clean:
rm -f ex22_main ex22.o ex22_main.o
.PHONY: all clean