-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
39 lines (29 loc) · 602 Bytes
/
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
ROM_NAME = dinoboy.gb
# Directories
TOOLS_DIR = ~/code/gb_dev
GBDK_DIR = $(TOOLS_DIR)/gbdk
SRC_DIR = ./src
DIST_DIR = ./bin
OBJ_DIR = ./build
# Binaries
CC = $(GBDK_DIR)/bin/lcc
EMULATOR = $(TOOLS_DIR)/bgb/bgb.exe
# Files
ROM_FILE = $(DIST_DIR)/$(ROM_NAME)
OBJ_FILES = $(OBJ_DIR)/main.o
all: $(ROM_FILE)
$(ROM_FILE): $(OBJ_FILES)
@mkdir -p $(DIST_DIR)
$(CC) -o $@ $^
$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c
@mkdir -p $(OBJ_DIR)
$(CC) -c -o $@ $<
.PHONY : build
build: $(ROM_FILE)
.PHONY : run
run: $(ROM_FILE)
wine $(EMULATOR) $<
.PHONY : clean
clean:
@rm -rf $(DIST_DIR)
@rm -rf $(OBJ_DIR)