-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (23 loc) · 835 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
CC=gcc
CFLAGS=-Wall -g
CINPUTFILE=src/input/input-text
CGRAMMARFILE=src/input/grammar-definer
COUTPUTFILE=src/input/output-file
all: slap
clear
./bin/slap.out $(CINPUTFILE) $(CGRAMMARFILE) $(COUTPUTFILE)
# @make clean -s
# I needed to clean up directories when I was compiling and working in the parent folder, but now I can just keep it in the bin folder
genrules: gram.o token.o
gcc -g -c src/genrules.c -o bin/genrules.o
gcc -g bin/genrules.o bin/gram.o bin/token.o -o bin/genrules.out
slap: main.o gram.o token.o
$(CC) $(CFLAGS) bin/main.o bin/gram.o bin/token.o -o bin/slap.out
main.o: src/main.c
$(CC) $(CFLAGS) -c src/main.c -o bin/main.o
gram.o: src/gram.c
$(CC) $(CFLAGS) -c src/gram.c -o bin/gram.o
token.o: src/token.c
$(CC) $(CFLAGS) -c src/token.c -o bin/token.o
clean:
@rm bin/main.o bin/gram.o bin/slap