forked from t00sh/rop-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.windows
45 lines (33 loc) · 1.02 KB
/
Makefile.windows
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
.PHONY: clean release
include Makefile.inc
CAPSTONE_VERSION=$(shell sed -rn "s/^Version:\s(.*)/\1/p" ./capstone-linux32/capstone.pc)
ifeq ($(ARCH), i686)
CC = i686-w64-mingw32-gcc
STATIC_LIBS = ./capstone-$(CAPSTONE_VERSION)-win32/capstone.dll
else
CC = x86_64-w64-mingw32-gcc
ARCH = x86_64
STATIC_LIBS = ./capstone-$(CAPSTONE_VERSION)-win64/capstone.dll
endif
CFLAGS = -O2 -Wall -Wextra -Wwrite-strings -Wstrict-prototypes -Wuninitialized
CFLAGS += -Wunreachable-code -g
CFLAGS += -DVERSION="\"$(VERSION)\"" -DPACKAGE="\"$(PACKAGE)\""
CFLAGS += -mwindows -D__WINDOWS__
CFLAGS += -I include/ -I ./capstone-linux32/include/
SRC = $(wildcard api/*/*.c)
SRC += $(wildcard src/*.c)
SRC += $(wildcard src/*/*.c)
OBJ = $(SRC:%.c=%.o)
EXE = $(PACKAGE)-Windows-$(ARCH)
all: $(EXE)
$(EXE): $(OBJ)
@echo " LINK $@"
@$(CC) $(CFLAGS) -o $@ $(OBJ) $(STATIC_LIBS) -static
%.o:%.c
@echo " CC $@" ;
@$(CC) $(CFLAGS) -c $< -o $@ ;
clean:
rm -f $(EXE) $(OBJ)
find . -name "*~" -delete
release: $(EXE)
gpg --armor --detach-sign $(EXE)