aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/makefile b/makefile
index 31a4316..8a6ddb4 100644
--- a/makefile
+++ b/makefile
@@ -3,6 +3,7 @@
3 3
4# DIRECTORIES 4# DIRECTORIES
5SRC_DIR := src 5SRC_DIR := src
6RES_DIR := res
6OUT_DIR := out 7OUT_DIR := out
7DOC_DIR := doc 8DOC_DIR := doc
8 9
@@ -25,6 +26,8 @@ REPORT_PDF := rapport.pdf
25CC := gcc 26CC := gcc
26LEX := flex 27LEX := flex
27YACC := bison 28YACC := bison
29ASM := nasm
30AFLAGS := -f elf64
28CFLAGS := -ansi -pedantic -Wall -std=gnu99 -O2 31CFLAGS := -ansi -pedantic -Wall -std=gnu99 -O2
29LFLAGS := -lfl -ly 32LFLAGS := -lfl -ly
30IFLAGS += -I$(SRC_DIR) -I$(OUT_DIR) 33IFLAGS += -I$(SRC_DIR) -I$(OUT_DIR)
@@ -32,6 +35,15 @@ IFLAGS += -I$(SRC_DIR) -I$(OUT_DIR)
32# RULES 35# RULES
33all: clean $(OUT_DIR)/$(COMPIL_BIN) 36all: clean $(OUT_DIR)/$(COMPIL_BIN)
34 37
38test: $(OUT_DIR)/$(FILE_TEST).o
39 $(CC) $< -o $(OUT_DIR)/$(FILE_TEST) -nostartfiles
40
41$(OUT_DIR)/$(FILE_TEST).o: $(OUT_DIR)/$(FILE_TEST).asm
42 $(ASM) $(AFLAGS) $< -o $@
43
44$(OUT_DIR)/$(FILE_TEST).asm: $(RES_DIR)/$(FILE_TEST).tpc $(OUT_DIR)/$(COMPIL_BIN)
45 $(OUT_DIR)/$(COMPIL_BIN) < $< > $@
46
35$(OUT_DIR)/$(LEX_GEN).c: $(SRC_DIR)/$(LEX_SRC) 47$(OUT_DIR)/$(LEX_GEN).c: $(SRC_DIR)/$(LEX_SRC)
36 $(LEX) -o $@ $^ 48 $(LEX) -o $@ $^
37 49