CC = gcc CFLAGS = -Wall -g -I.. CFLAGS += -DHOME_DIR="\"$(shell pwd)\"" #CFLAGS += -DX86_64 DEPC=\ ../msg.c\ ../util.c\ ../err.c TESTC= test.c TESTO=$(TESTC:.c=.o) DEPO=$(DEPC:.c=.o) # this is a test C = $(sort $(TESTC) $(DEPC)) O = $(C:.c=.o) TARG=test all: $(TARG) $(DEPO): make -C .. test: $(O) $(CC) -o $@ $^ .c.o: $(CC) $(CFLAGS) -c $< -include depend depend: Makefile $(CC) $(CFLAGS) -MM $(C) > depend clean: rm -f depend *~ core* $(TESTO) $(TARG)