-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
185 lines (155 loc) · 5.63 KB
/
Makefile
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
#
# Copyright (c) 2007, Cameron Rich
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the axTLS project nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
-include config/.config
ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
all: menuconfig
else
all: target
endif
include config/makefile.conf
target : $(STAGE) $(TARGET)
# VERSION has to come from the command line
RELEASE=axTLS-$(VERSION)
# standard version
target:
$(MAKE) -C crypto
$(MAKE) -C ssl
ifdef CONFIG_AXHTTPD
$(MAKE) -C httpd
endif
ifdef CONFIG_AXTLSWRAP
$(MAKE) -C axtlswrap
endif
ifdef CONFIG_BINDINGS
$(MAKE) -C bindings
endif
ifdef CONFIG_SAMPLES
$(MAKE) -C samples
endif
$(STAGE) : ssl/version.h
@mkdir -p $(STAGE)
# create a version file with something in it.
ssl/version.h:
@echo "#define AXTLS_VERSION \"(no version)\"" > ssl/version.h
$(PREFIX) :
@mkdir -p $(PREFIX)/lib
@mkdir -p $(PREFIX)/bin
release:
$(MAKE) -C config/scripts/config clean
-$(MAKE) clean
-@rm config/*.msi config/*.back.aip config/config.h config/.config*
-@rm www/index.20*
-@rm -fr $(STAGE)
@echo "#define AXTLS_VERSION \"$(VERSION)\"" > ssl/version.h
cd ../; tar cvfz $(RELEASE).tar.gz --wildcards-match-slash --exclude .svn axtls-code; cd -;
docs:
$(MAKE) -C docsrc doco
# build the Win32 demo release version
win32_demo:
@echo "#define AXTLS_VERSION \"$(VERSION)\"" > ssl/version.h
$(MAKE) win32releaseconf
install: $(PREFIX) all
cp --no-dereference $(STAGE)/libax* $(PREFIX)/lib
chmod 755 $(PREFIX)/lib/libax*
ifdef CONFIG_SAMPLES
install -m 755 $(STAGE)/ax* $(PREFIX)/bin
endif
ifdef CONFIG_HTTP_HAS_AUTHORIZATION
install -m 755 $(STAGE)/htpasswd $(PREFIX)/bin
endif
ifdef CONFIG_PLATFORM_CYGWIN
install -m 755 $(STAGE)/cygaxtls.dll $(PREFIX)/bin
endif
ifdef CONFIG_PERL_BINDINGS
install -m 755 $(STAGE)/axtlsp.pm `perl -e 'use Config; print $$Config{installarchlib};'`
endif
@mkdir -p -m 755 $(PREFIX)/include/axTLS
install -m 644 crypto/*.h $(PREFIX)/include/axTLS
install -m 644 ssl/*.h $(PREFIX)/include/axTLS
-rm $(PREFIX)/include/axTLS/cert.h
-rm $(PREFIX)/include/axTLS/private_key.h
install -m 644 config/config.h $(PREFIX)/include/axTLS
installclean:
-@rm $(PREFIX)/lib/libax* > /dev/null 2>&1
-@rm $(PREFIX)/bin/ax* > /dev/null 2>&1
-@rm $(PREFIX)/bin/axhttpd* > /dev/null 2>&1
-@rm `perl -e 'use Config; print $$Config{installarchlib};'`/axtlsp.pm > /dev/null 2>&1
test:
cd $(STAGE); ssltest; ../ssl/test/test_axssl.sh; cd -;
# tidy up things
clean::
@cd crypto; $(MAKE) clean
@cd ssl; $(MAKE) clean
@cd httpd; $(MAKE) clean
@cd axtlswrap; $(MAKE) clean
@cd samples; $(MAKE) clean
@cd docsrc; $(MAKE) clean
@cd bindings; $(MAKE) clean
# ---------------------------------------------------------------------------
# mconf stuff
# ---------------------------------------------------------------------------
CONFIG_CONFIG_IN = config/Config.in
CONFIG_DEFCONFIG = config/defconfig
config/scripts/config/conf: config/scripts/config/Makefile
$(MAKE) -C config/scripts/config conf
-@if [ ! -f config/.config ] ; then \
cp $(CONFIG_DEFCONFIG) config/.config; \
fi
config/scripts/config/mconf: config/scripts/config/Makefile
$(MAKE) -C config/scripts/config ncurses conf mconf
-@if [ ! -f config/.config ] ; then \
cp $(CONFIG_DEFCONFIG) .config; \
fi
cleanconf:
$(MAKE) -C config/scripts/config clean
@rm -f config/.config
menuconfig: config/scripts/config/mconf
@./config/scripts/config/mconf $(CONFIG_CONFIG_IN)
config: config/scripts/config/conf
@./config/scripts/config/conf $(CONFIG_CONFIG_IN)
oldconfig: config/scripts/config/conf
@./config/scripts/config/conf -o $(CONFIG_CONFIG_IN)
default: config/scripts/config/conf
@./config/scripts/config/conf -d $(CONFIG_CONFIG_IN) > /dev/null
$(MAKE)
randconfig: config/scripts/config/conf
@./config/scripts/config/conf -r $(CONFIG_CONFIG_IN)
allnoconfig: config/scripts/config/conf
@./config/scripts/config/conf -n $(CONFIG_CONFIG_IN)
allyesconfig: config/scripts/config/conf
@./config/scripts/config/conf -y $(CONFIG_CONFIG_IN)
# The special win32 release configuration
win32releaseconf: config/scripts/config/conf
@./config/scripts/config/conf -D config/win32config $(CONFIG_CONFIG_IN) > /dev/null
$(MAKE)
# The special linux release configuration
linuxconf: config/scripts/config/conf
@./config/scripts/config/conf -D config/linuxconfig $(CONFIG_CONFIG_IN) > /dev/null
$(MAKE)