backend

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.deepztream.com/backend
Log | Files | Refs | Submodules

Makefile (876B)


      1 BUILD_DIR = build
      2 SRC_FILES = src/ir_backend.c \
      3 						src/phi.c \
      4 						src/x86_64-codegen.c \
      5 						dlib/dlib.h \
      6 						src/backend.h \
      7 						src/parse.c \
      8 						src/lexer.h \
      9 						src/lexer.c
     10 
     11 CFLAGS=-ggdb -Og -Wall -Wextra -Wswitch-enum -I./dlib
     12 
     13 .PHONY: parse clean
     14 all: $(BUILD_DIR)/parse $(BUILD_DIR)/parse_output
     15 
     16 $(BUILD_DIR)/parse: $(SRC_FILES)
     17 	mkdir -p $(BUILD_DIR)
     18 	gcc $(CFLAGS) -o $@ src/parse.c src/lexer.c
     19 
     20 $(BUILD_DIR)/parse_output: $(BUILD_DIR)/parse_output.o
     21 	mkdir -p $(BUILD_DIR)
     22 	gcc $(CFLAGS) -no-pie -o $@ $(BUILD_DIR)/parse_output.o
     23 
     24 $(BUILD_DIR)/parse_output.o: $(BUILD_DIR)/parse_output.nasm
     25 	mkdir -p $(BUILD_DIR)
     26 	nasm -felf64 -o $@ $(BUILD_DIR)/parse_output.nasm
     27 
     28 $(BUILD_DIR)/parse_output.nasm: $(BUILD_DIR)/parse
     29 	mkdir -p $(BUILD_DIR)
     30 	./$(BUILD_DIR)/parse test/test.ir
     31 
     32 clean:
     33 	rm -rf $(BUILD_DIR)/*
     34 
     35 tags: $(SRC_FILES)
     36 	ctags $(SRC_FILES)