diff options
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 |
