-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakeFile
More file actions
35 lines (25 loc) · 857 Bytes
/
Copy pathMakeFile
File metadata and controls
35 lines (25 loc) · 857 Bytes
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
CC = gcc
EXEC = main
FLAG = -std=c99
BUILD_DIR = build
SOURCE_DIR = src
HEADER_DIR = $(SOURCE_DIR)/header
all : $(EXEC)
$(EXEC) : $(BUILD_DIR)/main.o $(BUILD_DIR)/node.o $(BUILD_DIR)/tree.o $(BUILD_DIR)/mcduck.o
$(CC) -o $(EXEC) $^ $(FLAG)
$(BUILD_DIR)/mcduck.o : $(SOURCE_DIR)/mcduck.c $(BUILD_DIR)
$(CC) -o $@ -c $< $(FLAG)
$(BUILD_DIR)/node.o : $(SOURCE_DIR)/node.c $(HEADER_DIR)/mcduck.h $(BUILD_DIR)
$(CC) -o $@ -c $< $(FLAG)
$(BUILD_DIR)/tree.o : $(SOURCE_DIR)/tree.c $(HEADER_DIR)/mcduck.h $(HEADER_DIR)/node.h $(BUILD_DIR)
$(CC) -o $@ -c $< $(FLAG)
$(BUILD_DIR)/main.o : $(SOURCE_DIR)/main.c $(HEADER_DIR)/mcduck.h $(HEADER_DIR)/node.h $(HEADER_DIR)/tree.h $(BUILD_DIR)
$(CC) -o $@ -c $< $(FLAG)
$(BUILD_DIR) :
mkdir $(BUILD_DIR)
clean :
-del $(BUILD_DIR)
graphclean :
-del graph.dot
mrproper : clean graphclean
-del $(EXEC).exe