diff options
-rw-r--r-- | makefile | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | # DIRECTORIES | 4 | # DIRECTORIES |
5 | SRC_DIR := src | 5 | SRC_DIR := src |
6 | RES_DIR := res | ||
6 | OUT_DIR := out | 7 | OUT_DIR := out |
7 | DOC_DIR := doc | 8 | DOC_DIR := doc |
8 | 9 | ||
@@ -25,6 +26,8 @@ REPORT_PDF := rapport.pdf | |||
25 | CC := gcc | 26 | CC := gcc |
26 | LEX := flex | 27 | LEX := flex |
27 | YACC := bison | 28 | YACC := bison |
29 | ASM := nasm | ||
30 | AFLAGS := -f elf64 | ||
28 | CFLAGS := -ansi -pedantic -Wall -std=gnu99 -O2 | 31 | CFLAGS := -ansi -pedantic -Wall -std=gnu99 -O2 |
29 | LFLAGS := -lfl -ly | 32 | LFLAGS := -lfl -ly |
30 | IFLAGS += -I$(SRC_DIR) -I$(OUT_DIR) | 33 | IFLAGS += -I$(SRC_DIR) -I$(OUT_DIR) |
@@ -32,6 +35,15 @@ IFLAGS += -I$(SRC_DIR) -I$(OUT_DIR) | |||
32 | # RULES | 35 | # RULES |
33 | all: clean $(OUT_DIR)/$(COMPIL_BIN) | 36 | all: clean $(OUT_DIR)/$(COMPIL_BIN) |
34 | 37 | ||
38 | test: $(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 | ||