diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2014-05-16 00:03:12 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2014-05-16 00:03:12 +0300 |
| commit | 8cb320351cfd95acbca06a4f59e79adc70ed52bf (patch) | |
| tree | c8fc0dcafb9b304b55d48e6da0b3c86e4ec706bb /Makefile | |
| parent | a1a0fa8aba7e8a33d5fa6c9ace10338296615edc (diff) | |
| download | lispish-8cb320351cfd95acbca06a4f59e79adc70ed52bf.tar.gz lispish-8cb320351cfd95acbca06a4f59e79adc70ed52bf.zip | |
Makefile: allow building test/repl at the same time (use different object files)
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,5 +1,6 @@ SOURCES = parse.c list.c atom.c eval.c tokens.c env.c OBJECTS = $(SOURCES:.c=.o) +TEST_OBJECTS = $(foreach obj,$(OBJECTS),test_$(obj)) CFLAGS = -Wall -g LDFLAGS = @@ -7,19 +8,18 @@ LDFLAGS = CC = gcc LD = gcc -# ifneq ($(BUILD_TEST),) +all: test repl + +test_%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $^ test: CFLAGS := $(CFLAGS) -DBUILD_TEST -test: $(OBJECTS) tst_main.o +test: $(TEST_OBJECTS) tst_main.o $(LD) $(LDFLAGS) -o $@ $^ -# else - repl: $(OBJECTS) repl.o linenoise.o $(LD) $(LDFLAGS) -o $@ $^ -# endif - .PHONY: clean clean: rm -f *.o |
