From 49662d2162ef19a137faf17736fb7641d0b61452 Mon Sep 17 00:00:00 2001 From: Adam NAILI Date: Mon, 7 May 2018 01:15:33 +0200 Subject: Adding make test command --- makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/makefile b/makefile index 31a4316..8a6ddb4 100644 --- a/makefile +++ b/makefile @@ -3,6 +3,7 @@ # DIRECTORIES SRC_DIR := src +RES_DIR := res OUT_DIR := out DOC_DIR := doc @@ -25,6 +26,8 @@ REPORT_PDF := rapport.pdf CC := gcc LEX := flex YACC := bison +ASM := nasm +AFLAGS := -f elf64 CFLAGS := -ansi -pedantic -Wall -std=gnu99 -O2 LFLAGS := -lfl -ly IFLAGS += -I$(SRC_DIR) -I$(OUT_DIR) @@ -32,6 +35,15 @@ IFLAGS += -I$(SRC_DIR) -I$(OUT_DIR) # RULES all: clean $(OUT_DIR)/$(COMPIL_BIN) +test: $(OUT_DIR)/$(FILE_TEST).o + $(CC) $< -o $(OUT_DIR)/$(FILE_TEST) -nostartfiles + +$(OUT_DIR)/$(FILE_TEST).o: $(OUT_DIR)/$(FILE_TEST).asm + $(ASM) $(AFLAGS) $< -o $@ + +$(OUT_DIR)/$(FILE_TEST).asm: $(RES_DIR)/$(FILE_TEST).tpc $(OUT_DIR)/$(COMPIL_BIN) + $(OUT_DIR)/$(COMPIL_BIN) < $< > $@ + $(OUT_DIR)/$(LEX_GEN).c: $(SRC_DIR)/$(LEX_SRC) $(LEX) -o $@ $^ -- cgit v1.2.3