-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (27 loc) · 1.2 KB
/
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
.PHONY: all src test clean
FLAGS = -Wall -Werror -pedantic
SRC = stack instructions preprocess compile
TEST = stack-test instructions-test preprocess-test
src: ${SRC}
test:
./bin/stack_test
./bin/preprocess_test
./bin/instructions_test
all: ${SRC} ${TEST}
clean:
rm bin/*
rm output/*
compile: src/compile.c
gcc src/compile.c src/stack.c src/preprocess.c src/instructions.c -o bin/compile ${FLAGS}
stack: src/stack.c src/stack.h
gcc -c src/stack.c -o bin/stack.o ${FLAGS}
stack-test: src/stack.c src/stack.h src/preprocess.h test/stack_test.c
gcc test/stack_test.c src/stack.c src/preprocess.c -o bin/stack_test ${FLAGS}
instructions: src/instructions.c src/instructions.h
gcc -c src/instructions.c -o bin/instructions.o ${FLAGS}
instructions-test: src/instructions.c src/instructions.h test/instructions_test.c
gcc test/instructions_test.c src/instructions.c -o bin/instructions_test ${FLAGS}
preprocess: src/stack.c src/stack.h src/preprocess.c src/preprocess.h
gcc -c src/preprocess.c -o bin/preprocess ${FLAGS}
preprocess-test: src/stack.c src/stack.h src/preprocess.c src/preprocess.h test/preprocess_test.c
gcc src/stack.c src/preprocess.c test/preprocess_test.c -o bin/preprocess_test ${FLAGS}