-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (27 loc) · 649 Bytes
/
Makefile
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
28
29
30
31
32
33
34
35
36
37
38
39
# Calcium Makefile
# See COPYING for licensing details.
CC := gcc
CFLAGS := -Wall
LDFLAGS := -lm
TEST_DIR := test/
OBJS := eval.o \
hashmap.o \
interpreter.o \
main.o \
stack.o
INTERPRETER_EXEC = calcium
TEST_OBJS := test_stack.o \
test_hash.o
.PHONY: all clean build-interpreter
all: $(INTERPRETER_EXEC)
%.o: %.c
$(CC) $(CFLAGS) -c $^ -o $@
test/%: build test/%.c
$(CC) $(CFLAGS) $^ -o $@ $(OBJS)
clean:
rm *.o
rm $(INTERPRETER_EXEC)
rm test/*.o
build-interpreter: $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o $(INTERPRETER_EXEC)
$(INTERPRETER_EXEC): build-interpreter