forked from camthesaxman/gbadisasm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·35 lines (28 loc) · 815 Bytes
/
Makefile
File metadata and controls
executable file
·35 lines (28 loc) · 815 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
CAPSTONE_ARCHIVE := capstone-3.0.5-rc2.tar.gz
CAPSTONE_DIR := capstone-3.0.5-rc2
CAPSTONE_LIB := $(CAPSTONE_DIR)/libcapstone.a
DEBUG ?= 0
CC := gcc
CFLAGS := -isystem $(CAPSTONE_DIR)/include -Wall -Wextra -Wpedantic
ifeq ($(DEBUG),1)
CFLAGS += -O0 -g
else
CFLAGS += -O3
endif
#CFLAGS += -fsanitize=address
PROGRAM := gbadisasm
SOURCES := main.c disasm.c
LIBS := $(CAPSTONE_LIB)
# Compile the program
$(PROGRAM): $(SOURCES) $(CAPSTONE_LIB)
$(CC) $(CFLAGS) $^ -o $@
# Build libcapstone
$(CAPSTONE_LIB): $(CAPSTONE_DIR)
make -C $(CAPSTONE_DIR) CAPSTONE_STATIC=yes CAPSTONE_SHARED=no CAPSTONE_ARCHS="arm"
# Extract the archive
$(CAPSTONE_DIR): $(CAPSTONE_ARCHIVE)
tar -xvf $(CAPSTONE_ARCHIVE)
clean:
$(RM) $(PROGRAM) $(PROGRAM).exe
distclean: clean
rm -rf $(CAPSTONE_DIR)