-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
43 lines (31 loc) · 696 Bytes
/
Copy pathmakefile
File metadata and controls
43 lines (31 loc) · 696 Bytes
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
40
41
42
CC=gcc
CFLAGS=-Wall
LEX=flex
YACC=bison
YFLAGS=-d
OBJ=obj/
SRC=src/
LEXFILE=$(SRC)interpreteur.l
YACCFILE=$(SRC)interpreteur.y
BIN=interpreteur
MAIN=$(SRC)main.c
PARSER=$(OBJ)parser.o
PARSER_SRC=$(SRC)parser.c
PARSER_H=$(SRC)parser.h
LEXER=$(OBJ)lexer.o
LEXER_SRC=$(SRC)lexer.c
all: $(BIN)
$(BIN): $(PARSER) $(LEXER)
$(CC) $(CFLAGS) -o $@ $(MAIN) $^ -ll
$(PARSER): $(PARSER_SRC)
$(CC) $(CFLAGS) -c -o $@ $^
$(LEXER): $(LEXER_SRC)
$(CC) $(CFLAGS) -c -o $@ $^
$(LEXER_SRC):
$(LEX) -o $@ $(LEXFILE)
$(PARSER_SRC):
$(YACC) $(YFLAGS) -o $@ $(YACCFILE)
clean:
rm $(OBJ)*.o $(PARSER_SRC) $(PARSER_H) $(LEXER_SRC)
fullclean:
rm $(BIN) $(OBJ)*.o $(PARSER_SRC) $(PARSER_H) $(LEXER_SRC)