aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: c37b196e101eaa52671887fa34bd129e2eb12c4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
SOURCES = parse.c list.c atom.c eval.c tokens.c env.c
OBJECTS = $(SOURCES:.c=.o)

CFLAGS = -Wall -g
LDFLAGS =

CC = gcc
LD = gcc

# ifneq ($(BUILD_TEST),)

test: CFLAGS := $(CFLAGS) -DBUILD_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
	rm -f test
	rm -f repl