forked from yarrick/iodine
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile.am
159 lines (120 loc) · 5.57 KB
/
Makefile.am
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
## Process this file with automake to produce Makefile.in
################################################################
## shared ##
################################################################
AM_CPPFLAGS = -D$(OS)
if DEBUG
AM_CFLAGS = -pedantic -O0 -g3 -DDEBUG_BUILD
else
AM_CFLAGS = -pedantic -O3 -fno-strict-aliasing
endif
################################################################
## docs ##
################################################################
dist_man_MANS = man/iodine.8
dist_doc_DATA = CHANGELOG README.md README-android.txt README-win32.txt \
TODO doc/proto_00000402.txt doc/proto_00000500.txt \
doc/proto_00000502.txt doc/proto_00000800.txt
################################################################
## misc ##
################################################################
EXTRA_DIST = .travis.yml doc/iodine-server.service \
doc/iodine-server.socket doc/iodine.te src/Android.mk
################################################################
## src/ ##
################################################################
sbin_PROGRAMS = iodine iodined
iodine_CFLAGS = $(AM_CFLAGS)
iodined_CFLAGS = $(AM_CFLAGS)
COMMONSRC0 = src/base32.c src/base64.c src/common.c src/dns.c \
src/encoding.c src/login.c src/md5.c src/read.c src/window.c \
src/util.c
COMMONSRC = $(COMMONSRC0) src/base128.c src/tun.c src/base64u.c \
src/base64u.h src/android_dns.h src/base128.h src/base32.h \
src/base64.h src/common.h src/dns.h src/encoding.h src/login.h \
src/md5.h src/read.h src/tun.h src/version.h src/windows.h \
src/util.h src/window.h
iodine_SOURCES = $(COMMONSRC) src/iodine.c src/client.c \
src/client.h
iodined_SOURCES = $(COMMONSRC) src/iodined.c src/server.c \
src/server.h src/user.c src/fw_query.c src/fw_query.h src/user.h
EXTRA_DIST += src/android_dns.h src/base128.h src/base32.h \
src/base64.h src/client.h src/common.h src/dns.h src/encoding.h \
src/fw_query.h src/login.h src/md5.h src/read.h src/tun.h src/user.h \
src/util.h src/version.h src/windows.h
src/base64u.c: src/base64.c
@echo Making $@
@echo '/* No use in editing, produced by Makefile! */' > $@
sed -e 's/\([Bb][Aa][Ss][Ee]64\)/\1u/g ; s/\([Bb]64\)/\1u/g ; s/0123456789+/0123456789_/' < $< >> $@
src/base64u.h: src/base64.h
@echo Making $@
@echo '/* No use in editing, produced by Makefile! */' > $@
sed -e 's/\([Bb][Aa][Ss][Ee]64\)/\1u/g ; s/\([Bb]64\)/\1u/g ; s/0123456789+/0123456789_/' < $< >> $@
BUILT_SOURCES = src/base64u.c src/base64u.h
MOSTLYCLEANFILES = src/base64u.c src/base64u.h
clean-local:
@echo Clean Android Stuff
-rm -rf src/obj src/libs
################################################################
## tests/ ##
################################################################
if HAVE_CHECK
TESTS = test-iodine
noinst_PROGRAMS = test-iodine
test_iodine_SOURCES = tests/test.c tests/base32.c tests/base64.c \
tests/common.c tests/read.c tests/dns.c tests/encoding.c \
tests/login.c tests/user.c tests/fw_query.c tests/window.c $(COMMONSRC0) \
src/user.c src/fw_query.c
EXTRA_DIST += tests/test.h
test_iodine_LDADD = $(CHECK_LIBS)
test_iodine_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS)
test_iodine_CPPFLAGS = $(AM_CPPFLAGS) -I src
endif
################################################################
## Ancient History ##
################################################################
# retain compatibility with former target "test"
.PHONY: test
test: check
# Compile for Android.
# It is likely possible to tweak autotools into supporting this
# configuration, once that is tested the below should be removed.
.PHONY: cross-android
cross-android: src/base64u.c src/base64u.h
(cd src; ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk)
.PHONY: cross-android-dist
cross-android-dist:
rm -rf iodine-latest-android*
mkdir -p iodine-latest-android/armeabi iodine-latest-android/x86
$(MAKE) cross-android TARGET_ARCH_ABI=armeabi
cp src/libs/armeabi/* iodine-latest-android/armeabi
$(MAKE) cross-android TARGET_ARCH_ABI=x86
cp src/libs/x86/* iodine-latest-android/x86
cp README.md README-android.txt CH* TO* iodine-latest-android/
echo "Create date: " > iodine-latest-android/VERSION
date >> iodine-latest-android/VERSION
echo "Git version: " >> iodine-latest-android/VERSION
echo $(GITREVISION) >> iodine-latest-android/VERSION
zip -r iodine-latest-android.zip iodine-latest-android
# Compile for MS Windows.
# This platform is supported by autotools, so the below should be removed once
# autotools is tested in that configuration.
.PHONY: cross-mingw
cross-mingw:
echo "WARNING:"
echo "This make target is unlikely to work properly."
echo "Cross compilation is supported by autotools."
echo " ./configure --build=turingmachine-unknown-linux-gnu --host=mingw32"
$(MAKE) OS=WINDOWS32 CC=i686-mingw32-gcc all
.PHONY: cross-mingw-dist
cross-mingw-dist: cross-mingw
rm -rf iodine-latest-win32*
mkdir -p iodine-latest-win32/bin
for i in `ls bin`; do cp bin/$$i iodine-latest-win32/bin/$$i.exe; done
cp /usr/i686-mingw32/usr/bin/zlib1.dll iodine-latest-win32/bin/
cp README.md README-win32.txt CH* TO* iodine-latest-win32/
echo "Create date: " > iodine-latest-win32/VERSION
date >> iodine-latest-win32/VERSION
echo "Git version: " >> iodine-latest-win32/VERSION
echo $(GITREVISION) >> iodine-latest-win32/VERSION
zip -r iodine-latest-win32.zip iodine-latest-win32