-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
248 lines (197 loc) · 8.21 KB
/
Makefile.in
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# Gforth integration Makefile
# Copyright (C) 2015 Bernd Paysan
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
package = $(DESTDIR)
VPATH = @srcdir@:.
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = $(package)@datadir@
srcdir = @srcdir@
bindir = $(package)@bindir@
libdir = $(package)@libdir@
sysconfdir = $(package)@sysconfdir@
VERSION = @PACKAGE_VERSION@
LIBCCDEST = $(libdir)/net2o/$(VERSION)/$(machine)/libcc-named
libccdir = $(subst $(package),,$(LIBCCDEST))
LIBS = keccak-low threefish bdelta @ED25519_DONNA@
MKDIR = mkdir
RMDIR = rm -rf
TAR = tar cf -
GCC = gcc
LIBTOOL = @GNU_LIBTOOL@
CFLAGS = -O3 -fomit-frame-pointer
HOST =
FAST = @FAST@
FORTHLIB = ed25519-donna.fs keccak.fs threefish.fs bdelta.fs
COMPRESS=xz -9
COMPEXT=.xz
SOURCES = 64bit.fs base64.fs base85.fs crypto-api.fs debugging.fs \
hash-table.fs keccak-small.fs kregion.fs n2o.fs addr.fs classes.fs \
cmd.fs connected.fs connect.fs crypt.fs dht.fs err.fs file.fs \
gui.fs gui-dark.fs net2o.fs ip.fs helper.fs keys.fs log.fs msg.fs \
notify.fs qr.fs socks.fs squid.fs tools.fs vault.fs rng.fs xtype.fs \
$(TESTS) $(FORTHLIB) ed25519-donnalib.fs keccaklib.fs keccaklow.fs \
threefishlib.fs startn2o.fs startn2ogui.fs doc/net2o-logo.png \
version.fs.in android/net.fs android/notify.fs linux/net.fs \
linux/notify.fs dhtroot.fs dvcs.fs qrscan.fs \
android/qrscan-android.fs linux/qrscan-linux.fs doc/net2o-200.png \
doc/net2o.png doc/user.png json/parser.fs json/g+-schema.fs \
json/g+-import.fs json/fb-schema.fs json/twitter-schema.fs \
json/test.fs json/test.json json/diaspora-schema.fs html/parser.fs \
xml/parser.fs xml/blogger-atom.fs n2o-completion.sh debian/rules \
debian/compat debian/net2o.postinst
ICONSIZES = 128x128 16x16 192x192 22x22 24x24 256x256 32x32 36x36 48x48 64x64 \
72x72
ICONS = $(patsubst %,icons/hicolor/%/apps/net2o.png,$(ICONSIZES)) \
icons/hicolor/scalable/apps/net2o.svg
ICONDIRS = $(patsubst %,icons/hicolor/%/apps,$(ICONSIZES) scalable)
DESKTOPDIR = applications
NOTIFYDIR = knotifications6
DESKTOP = $(DESKTOPDIR)/net2o.desktop
NOTIFYRC = $(NOTIFYDIR)/net2o.notifyrc
LANGS = net2o-lang.csv
CPUFLAGS = @CPUFLAGS@
ifeq "$(FAST)" "yes"
FORTHLIB += ed25519-donnafast.fs threefishfast.fs
else
SOURCES += ed25519-donnafast.fs threefishfast.fs
endif
SRC = .
ENGINE = @GFORTH@
GFORTH = $(basename $(ENGINE))
GFVER = @GFVER@
machine = @GFARCH@
LIBCCNAMED = lib/$(notdir $(GFORTH))/$(GFVER)/$(machine)/libcc-named
PREFIX = $(package)@prefix@
INCDIR = $(PREFIX)/include/$(GFVER)
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
ARCH =
DEBARCH =
GFORTH_FAST = `which gforth-fast`-`gforth-fast --version 2>&1| cut -f2- -d' ' | tr ' ' '-'`
INS = Makefile n2o n2o-fi.fs qrscan version.fs debian/changelog debian/control
TESTS = tests/alice2-msg.fs tests/alice-msg.fs tests/bob-msg.fs \
tests/copy.fs tests/cryptspeed.fs tests/dht.fs \
tests/dht-pop.fs tests/ed25519.fs tests/insdeltest.fs \
tests/keccak.fs tests/keys.fs tests/msg.fs \
tests/teststat.fs tests/threefish.fs tests/vault.fs \
tests/ed25519-table.fs tests/alice-test.fs \
tests/bob-test.fs tests/eve-test.fs tests/client-test.fs \
tests/client-tests.fs tests/server-test.fs \
tests/terminal-test.fs tests/test-keys.fs tests/dvcs-test \
tests/dvcs-test.s2o tests/dvcs-test2.s2o \
tests/termclient.fs tests/msg-test
@VERDIR@SRCPATH = net2o/$(VERSION)
@NOVERDIR@SRCPATH = net2o
SRCDIRS = $(SRCPATH)/tests $(SRCPATH)/doc $(SRCPATH)/android $(SRCPATH)/linux $(SRCPATH)/json $(SRCPATH)/html $(SRCPATH)/xml
SCRIPTS = n2o
GEN = version.fs
DOC = wiki/commands.md
DISTFILES = $(SOURCES) $(LANGS) $(ICONS) $(DESKTOP) $(NOTIFYRC) $(GEN) \
$(SCRIPTS) $(INS) $(INS:%=%.in)
all: no-config doc
distfiles:
@echo $(DISTFILES)
no-config: libs $(GEN)
clean: $(LIBS:%=%.clean)
%.clean:
cd $(@:%.clean=%); $(MAKE) clean
distclean: $(LIBS:%=%.distclean)
$(RMDIR) $(LIBCCNAMED)
%.distclean:
cd $(@:%.distclean=%); $(MAKE) distclean
configs $(CONFIGS:%.in=%): $(LIBS:%=%.configs) $(CONFIGS)
./configure --host=$(HOST) --prefix=$(PREFIX)
%.configs:
cd $(@:%.configs=%); ./autogen.sh CFLAGS="$(subst O2,O3,$(CFLAGS))" --host=$(HOST) --prefix=$(PREFIX) && $(MAKE) clean
libs: $(LIBS:%=%.libs)
%.libs:
cd $(@:%.libs=%); $(MAKE) all
install-libs: $(LIBS:%=%.instlibs)
%.instlibs:
cd $(@:%.instlibs=%); $(MAKE) package=$(package) install
extra-install: install-libs install
install: libcc-install
for i in $(SRCDIRS); do \
$(MKDIR) -p $(datadir)/$$i; \
done
-@VERDIR@rm $(datadir)/net2o
for i in $(SOURCES) $(LANGS); do \
$(INSTALL_DATA) $(srcdir)/$$i $(datadir)/$(SRCPATH)/$$i; \
done
for i in $(GEN); do \
$(INSTALL_DATA) ./$$i $(datadir)/$(SRCPATH)/$$i; \
done
$(MKDIR) -p $(bindir)
@VERDIR@for i in $(SCRIPTS); do \
@VERDIR@ $(INSTALL_SCRIPT) ./$$i $(bindir)/$$i-$(VERSION); \
@VERDIR@ ln -fs $$i-$(VERSION) $(bindir)/$$i; \
@VERDIR@done
@NOVERDIR@for i in $(SCRIPTS); do \
@NOVERDIR@ $(INSTALL_SCRIPT) ./$$i $(bindir)/$$i; \
@NOVERDIR@done
for i in $(ICONDIRS) $(DESKTOPDIR) $(NOTIFYDIR); do \
$(MKDIR) -p $(datadir)/$$i; \
done
for i in $(ICONS) $(DESKTOP) $(NOTIFYRC); do \
$(INSTALL_DATA) $(srcdir)/$$i $(datadir)/$$i; \
done
$(MKDIR) -p $(sysconfdir)/bash_completion.d
$(INSTALL_DATA) n2o-completion.sh $(sysconfdir)/bash_completion.d
%.dirui:
$(RMDIR) $(datadir)/gforth/$(GFVER)/$(@:%.dirui=%); \
%.scriptui:
-@VERDIR@$(RM) $(bindir)/$(@:%.scriptui=%)-$(VERSION); \
$(RM) $(bindir)/$(@:%.scriptui=%); \
uninstall: libcc-uninstall $(SRCDIRS:%=%.dirui) $(SCRIPTS:%=%.scriptui)
-@VERDIR@rm $(datadir)/gforth/$(GFVER)/net2o
libcc: $(FORTHLIB:%=%.libcc)
%.libcc:
-echo "generating library $(@:%.libcc=%)"
-for flags in $(CPUFLAGS); do $(ENGINE) unix/cpu.fs -e "also c-lib s\" $(LIBCCNAMED)/\" >libcc-named-dir libcc>named-path :noname 2drop s\" $(libccdir)/\" ; is replace-rpath previous s\" $$flags\" cpuflags \$$!" $(srcdir)/$(@:%.libcc=%) -e bye; done
net2o.fi: $(SOURCES) $(FORTHLIB) n2o-fi.fs
env GFORTH=$(GFORTH_FAST) GFORTH_PREAMBLE="#! $(GFORTH_FAST) --image-file" gforthmi net2o.fi ./n2o-fi.fs
libccdest:
$(MKDIR) -p $(LIBCCDEST)
libcc-install: install-libs libcc libccdest
if test -n "$(LIBTOOL)"; then for i in $(subst -,_,$(FORTHLIB)); do \
$(LIBTOOL) --silent --mode=install $(INSTALL) $(LIBCCNAMED)/libgf`basename $$i .fs`*.la $(LIBCCDEST)/; \
done; fi
libcc-uninstall:
if test -n "$(LIBTOOL)"; then for i in $(subst -,_,$(FORTHLIB)); do \
$(LIBTOOL) --silent --mode=uninstall $(RM) $(LIBCCDEST)/libgf`basename $$i .fs`.*; \
done; fi
doc: $(DOC)
wiki/commands.md: $(SOURCES)
gforth -e ': docgen ;' n2o.fs -e bye | sed -e "s/@VERSION@/$(VERSION)/g" >wiki/commands.md
TAGS: $(SOURCES) $(GEN) libcc
gforth etags.fs $(srcdir)/n2o.fs -e "bye" || >TAGS
mv TAGS net2o.TAGS
cat `gforth -e '"TAGS" open-fpath-file throw type bye'` net2o.TAGS >TAGS
configure: configure.ac
cd $(srcdir) && autoreconf --force --verbose $(srcdir)
$(INS): config.status $(INS:%=%.in)
./config.status
config.status: configure
./configure --host=$(HOST) --prefix=$(PREFIX)
dist: $(DISTFILES)
-$(RMDIR) net2o-$(VERSION)
mkdir net2o-$(VERSION)
$(TAR) $(DISTFILES) | (cd net2o-$(VERSION); tar xf -)
$(TAR) net2o-$(VERSION)|$(COMPRESS) >net2o-$(VERSION).tar$(COMPEXT)
-$(RMDIR) net2o-$(VERSION)
debdist:
PATH=/usr/bin:/bin CC="gcc -DFORCE_SYMVER=2.2.5 -Wl,--hash-style=both" dpkg-buildpackage -us -uc -d -b $(DEBARCH)
debdist32:
PATH=/usr/bin:/bin GFORTH=gforth-386 DEB_BUILD_OPTIONS=crossbuildcanrunhostbinaries CC="gcc -m32 -DFORCE_SYMVER=2.0 -Wl,--hash-style=both" dpkg-buildpackage -us -uc -d -b -ai386