-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (39 loc) · 1.36 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
CC = gcc
LD = ld
FLAGS = -Wall -O3 -lreadline
RM = rm -f
SRC_DIR = src
BUILD_DIR = build
INCLUDE_DIR = include
KCONFIG_DIR := .
KCONFIG_CONFIG := .config
all: simulator
simulator: $(BUILD_DIR)/main.o $(BUILD_DIR)/simulator.o \
$(BUILD_DIR)/instruction.o $(BUILD_DIR)/memory.o \
$(BUILD_DIR)/system.o $(BUILD_DIR)/log.o $(BUILD_DIR)/shell.o
$(CC) $(FLAGS) -o $@ $^
$(BUILD_DIR)/main.o: $(SRC_DIR)/main.c buildFolder
$(CC) $(FLAGS) -c $< -o $@ -I$(INCLUDE_DIR)
$(BUILD_DIR)/simulator.o: $(SRC_DIR)/simulator.c buildFolder
$(CC) $(FLAGS) -c $< -o $@ -I$(INCLUDE_DIR)
$(BUILD_DIR)/instruction.o: $(SRC_DIR)/instruction.c buildFolder
$(CC) $(FLAGS) -c $< -o $@ -I$(INCLUDE_DIR)
$(BUILD_DIR)/memory.o: $(SRC_DIR)/memory.c buildFolder
$(CC) $(FLAGS) -c $< -o $@ -I$(INCLUDE_DIR)
$(BUILD_DIR)/system.o: $(SRC_DIR)/system.c buildFolder
$(CC) $(FLAGS) -c $< -o $@ -I$(INCLUDE_DIR)
$(BUILD_DIR)/log.o: $(SRC_DIR)/log.c buildFolder
$(CC) $(FLAGS) -c $< -o $@ -I$(INCLUDE_DIR)
$(BUILD_DIR)/shell.o: $(SRC_DIR)/shell.c buildFolder
$(CC) $(FLAGS) -c $< -o $@ -I$(INCLUDE_DIR)
$(BUILD_DIR)/elf.o: $(SRC_DIR)/elf.c buildFolder
$(CC) $(FLAGS) -c $< -o $@ -I$(INCLUDE_DIR)
menuconfig:
$(MAKE) -C $(KCONFIG_DIR) menuconfig
oldconfig:
$(MAKE) -C $(KCONFIG_DIR) oldconfig
buildFolder:
mkdir -p $(BUILD_DIR)
clean:
$(RM) simulator $(BUILD_DIR)/*.o
.PHONY: all clean