forked from L1L1/cardpeek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.win32
115 lines (102 loc) · 5.39 KB
/
Makefile.win32
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
DEPS = /mingw32
TARGET = /C/Program Files (x86)/Cardpeek
MPLATFORM = mingw32
CC = $(CCPRE)gcc
GLIB_COMPILE_RESOURCES = glib-compile-resources
OBJECTS = asn1.o bytestring.o ui/gtk/gui_flexi_cell_renderer.o dyntree_model.o \
crypto.o replay.o ui.o iso7816.o lua_nodes.o lua_asn1.o \
lua_bit.o lua_bytes.o lua_card.o lua_crypto.o lua_ext.o \
lua_log.o lua_ui.o main.o misc.o pathconfig.o smartcard.o \
system_info.o a_string.o ui/gtk/gui_about.o ui/gtk/gui_toolbar.o \
ui/gtk/gui_logview.o ui/gtk/gui_cardview.o ui/gtk/gui_readerview.o \
http_download.o ui/gtk/gui_scratchpad.o ui/gtk/gui_inprogress.o \
ui/gtk/gui_core.o ui/console/console_core.o \
ui/console/console_about.o ui/console/console_inprogress.o \
lua_iconv.o win32/win32compat.o win32/resource.o \
cardpeek_resources.o cardpeek_update.o cardpeek.o
ICONS=icons/cardpeek-analyzer.png icons/cardpeek-item.png icons/cardpeek-record.png \
icons/cardpeek-smartcard.png icons/cardpeek-folder.png icons/cardpeek-logo.png \
icons/cardpeek-application.png icons/cardpeek-file.png icons/cardpeek-block.png \
icons/cardpeek-atr.png icons/cardpeek-header.png icons/cardpeek-body.png
export PKG_CONFIG_PATH=$(DEPS)/lib/pkgconfig
PKG_LIST = gtk+-3.0 lua openssl iconv libcurl
PKG_CFLAGS = `$(CCPRE)pkg-config --cflags $(PKG_LIST) | sed "s:-I/$(MPLATFORM):-I$(DEPS):g"`
PKG_LIBS = `$(CCPRE)pkg-config --libs $(PKG_LIST) | sed "s:-L/$(MPLATFORM):-L$(DEPS):g"`
CFLAGS = -Wall -pedantic -Wno-overlength-strings -Wno-long-long -DCURL_STATICLIB -D__USE_MINGW_ANSI_STDIO -I . -I $(DEPS)/include -I ./win32/ $(PKG_CFLAGS)
LIBS = $(PKG_LIBS) -L$(DEPS)/bin -L./win32/ -lwinscard -lreadline -lncurses
build: cardpeek.exe
cardpeek.exe: $(OBJECTS) #win32/libwinscard.a
$(CC) -Wl,-subsystem,windows $(OBJECTS) $(LIBS) -o cardpeek.exe
dot_cardpeek.tar.gz: dot_cardpeek_dir
@echo " TAR $<"
tar czf dot_cardpeek.tar.gz --directory dot_cardpeek_dir --exclude=.svn .
cardpeek_resources.o: dot_cardpeek.tar.gz $(ICONS) AUTHORS COPYING cardpeek_resources.gresource.xml
$(GLIB_COMPILE_RESOURCES) --generate-source --target=cardpeek_resources.c cardpeek_resources.gresource.xml
$(CC) $(CFLAGS) -c cardpeek_resources.c
@echo "COMPILED RESOURCES"
win32/resource.o: win32/resource.rc
$(CCPRE)windres win32/resource.rc -O coff -o win32/resource.o
#TODO: shouldn't be needed. To be confirmed. (It seems at least that it's not needed to compile)
#win32/libwinscard.a: win32/winscard.def win32/winscard.h
# $(CCPRE)dlltool -k -d win32/winscard.def -l win32/libwinscard.a win32/winscard.dll
clean:
rm -f $(OBJECTS) cardpeek.exe win32/libwinscard.a dot_cardpeek.tar.gz *~ cardpeek_resources.c
install: cardpeek.exe
mkdir -p "$(TARGET)"
cp -u cardpeek.exe "$(TARGET)/"
ifeq (mingw64, $(MPLATFORM))
cp -u $(DEPS)/bin/libgcc_s_seh-1.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libcrypto-1_1-x64.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libssl-1_1-x64.dll "$(TARGET)/"
else
ifneq (/mingw32, $(DEPS))
# not needed from msys2 - TODO: eliminate from debian too ()
cp -u $(DEPS)/bin/libgcc_s_sjlj-1.dll "$(TARGET)/"
endif
cp -u $(DEPS)/bin/libgcc_s_dw2-1.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libcrypto-1_1.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libssl-1_1.dll "$(TARGET)/"
endif
cp -u $(DEPS)/bin/libstdc++-6.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libatk-1.0-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libbrotlidec.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libbrotlicommon.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libbz2-1.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libcairo-2.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libcairo-gobject-2.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libcurl-4.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libdatrie-1.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libepoxy-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libexpat-1.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libffi-6.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libfontconfig-1.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libfreetype-6.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libfribidi-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libgdk-3-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libgdk_pixbuf-2.0-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libgio-2.0-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libglib-2.0-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libgmodule-2.0-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libgobject-2.0-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libgraphite2.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libgtk-3-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libharfbuzz-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libiconv-2.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libidn2-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libintl-8.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libnghttp2-14.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libpango-1.0-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libpangocairo-1.0-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libpangoft2-1.0-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libpangowin32-1.0-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libpcre-1.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libpixman-1-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libpng16-16.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libpsl-5.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libreadline7.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libtermcap-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libthai-0.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libunistring-2.dll "$(TARGET)/"
cp -u $(DEPS)/bin/libwinpthread-1.dll "$(TARGET)/"
cp -u $(DEPS)/bin/lua53.dll "$(TARGET)/"
cp -u $(DEPS)/bin/zlib1.dll "$(TARGET)/"