-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (27 loc) · 1.18 KB
/
Makefile
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
BUILD_DIR = ${CURDIR}/build
BIN_DIR = ${CURDIR}
SRC_DIR = ${CURDIR}/src
all:
gcc $(BUILD_DIR)/calculate.o $(BUILD_DIR)/errorhandler.o $(BUILD_DIR)/main.o $(BUILD_DIR)/parser.o $(BUILD_DIR)/qust.o $(BUILD_DIR)/scanner.o $(BUILD_DIR)/utils.o $(BUILD_DIR)/variable.o -lm -o $(BIN_DIR)/calc
$(BUILD_DIR)/calculate.o: $(SRC_DIR)/calculate.c
gcc -c $(SRC_DIR)/calculate.c -o $(BUILD_DIR)/calculate.o
$(BUILD_DIR)/errorhandler.o: $(SRC_DIR)/errorhandler.c
gcc -c $(SRC_DIR)/errorhandler.c -o $(BUILD_DIR)/errorhandler.o
$(BUILD_DIR)/main.o: $(SRC_DIR)/main.c
gcc -c $(SRC_DIR)/main.c -o $(BUILD_DIR)/main.o
$(BUILD_DIR)/parser.o: $(SRC_DIR)/parser.c
gcc -c $(SRC_DIR)/parser.c -o $(BUILD_DIR)/parser.o
$(BUILD_DIR)/qust.o: $(SRC_DIR)/qust.c
gcc -c $(SRC_DIR)/qust.c -o $(BUILD_DIR)/qust.o
$(BUILD_DIR)/scanner.o: $(SRC_DIR)/scanner.c
gcc -c $(SRC_DIR)/scanner.c -o $(BUILD_DIR)/scanner.o
$(BUILD_DIR)/utils.o: $(SRC_DIR)/utils.c
gcc -c $(SRC_DIR)/utils.c -o $(BUILD_DIR)/utils.o
$(BUILD_DIR)/variable.o: $(SRC_DIR)/variable.c
gcc -c $(SRC_DIR)/variable.c -o $(BUILD_DIR)/variable.o
clean:
ifeq ($(OS),Windows_NT)
cd $(BUILD_DIR) && del *.o
else
cd $(BUILD_DIR) && rm *.o
endif