Merge pull request #393 from nmav/no-group-match
[project/luci.git] / libs / luci-lib-nixio / axTLS / Makefile
1 #
2 # Copyright (c) 2007, Cameron Rich
3 #
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 #
9 # * Redistributions of source code must retain the above copyright notice,
10 #   this list of conditions and the following disclaimer.
11 # * Redistributions in binary form must reproduce the above copyright
12 #   notice, this list of conditions and the following disclaimer in the
13 #   documentation and/or other materials provided with the distribution.
14 # * Neither the name of the axTLS project nor the names of its
15 #   contributors may be used to endorse or promote products derived
16 #   from this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24 # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 
26 # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #
30
31 -include config/.config
32
33 ifneq ($(strip $(HAVE_DOT_CONFIG)),y)
34 all: menuconfig
35 else
36 all: target
37 endif
38
39 include config/makefile.conf
40
41 target : $(STAGE) $(TARGET)
42
43 # VERSION has to come from the command line
44 RELEASE=axTLS-$(VERSION)
45
46 # standard version
47 target:
48         $(MAKE) -C crypto
49         $(MAKE) -C ssl
50 ifdef CONFIG_AXHTTPD
51         $(MAKE) -C httpd
52 endif
53 ifdef CONFIG_BINDINGS
54         $(MAKE) -C bindings
55 endif
56 ifdef CONFIG_SAMPLES
57         $(MAKE) -C samples
58 endif
59
60 $(STAGE) : ssl/version.h
61         @mkdir -p $(STAGE)
62
63 # create a version file with something in it.
64 ssl/version.h:
65         @echo "#define AXTLS_VERSION    \"(no version)\"" > ssl/version.h
66
67 $(PREFIX) :
68         @mkdir -p $(PREFIX)/lib
69         @mkdir -p $(PREFIX)/bin
70
71 release:
72         $(MAKE) -C config/scripts/config clean
73         -$(MAKE) clean
74         -@rm config/*.msi config/*.back.aip config/config.h config/.config*
75         -@rm www/index.20*
76         -@rm -fr $(STAGE)
77         @echo "#define AXTLS_VERSION    \"$(VERSION)\"" > ssl/version.h
78         cd ../; tar cvfz $(RELEASE).tar.gz --wildcards-match-slash --exclude .svn axTLS; cd -;
79
80 docs:
81         $(MAKE) -C docsrc doco
82
83 # build the Win32 demo release version
84 win32_demo:
85         @echo "#define AXTLS_VERSION    \"$(VERSION)\"" > ssl/version.h
86         $(MAKE) win32releaseconf
87
88 install: $(PREFIX) all
89         cp --no-dereference $(STAGE)/libax* $(PREFIX)/lib
90         chmod 755 $(PREFIX)/lib/libax* 
91 ifdef CONFIG_SAMPLES
92         install -m 755 $(STAGE)/ax* $(PREFIX)/bin 
93 endif
94 ifdef CONFIG_HTTP_HAS_AUTHORIZATION
95         install -m 755 $(STAGE)/htpasswd $(PREFIX)/bin 
96 endif
97 ifdef CONFIG_PLATFORM_CYGWIN
98         install -m 755 $(STAGE)/cygaxtls.dll $(PREFIX)/bin 
99 endif
100 ifdef CONFIG_PERL_BINDINGS 
101         install -m 755 $(STAGE)/axtlsp.pm `perl -e 'use Config; print $$Config{installarchlib};'`
102 endif
103         @mkdir -p -m 755 $(PREFIX)/include/axTLS
104         install -m 644 crypto/*.h $(PREFIX)/include/axTLS
105         install -m 644 ssl/*.h $(PREFIX)/include/axTLS
106         -rm $(PREFIX)/include/axTLS/cert.h
107         -rm $(PREFIX)/include/axTLS/private_key.h
108         install -m 644 config/config.h $(PREFIX)/include/axTLS
109
110 installclean:
111         -@rm $(PREFIX)/lib/libax* > /dev/null 2>&1
112         -@rm $(PREFIX)/bin/ax* > /dev/null 2>&1
113         -@rm $(PREFIX)/bin/axhttpd* > /dev/null 2>&1
114         -@rm `perl -e 'use Config; print $$Config{installarchlib};'`/axtlsp.pm > /dev/null 2>&1
115
116 test:
117         cd $(STAGE); ssltest; ../ssl/test/test_axssl.sh; cd -;
118
119 # tidy up things
120 clean::
121         @cd crypto; $(MAKE) clean
122         @cd ssl; $(MAKE) clean
123         @cd httpd; $(MAKE) clean
124         @cd samples; $(MAKE) clean
125         @cd docsrc; $(MAKE) clean
126         @cd bindings; $(MAKE) clean
127
128 # ---------------------------------------------------------------------------
129 # mconf stuff
130 # ---------------------------------------------------------------------------
131
132 CONFIG_CONFIG_IN = config/Config.in
133 CONFIG_DEFCONFIG = config/defconfig
134
135 config/scripts/config/conf: config/scripts/config/Makefile
136         $(MAKE) -C config/scripts/config conf
137         -@if [ ! -f config/.config ] ; then \
138                 cp $(CONFIG_DEFCONFIG) config/.config; \
139         fi
140
141 config/scripts/config/mconf: config/scripts/config/Makefile
142         $(MAKE) -C config/scripts/config ncurses conf mconf
143         -@if [ ! -f config/.config ] ; then \
144                 cp $(CONFIG_DEFCONFIG) .config; \
145         fi
146
147 cleanconf:
148         $(MAKE) -C config/scripts/config clean
149         @rm -f config/.config
150
151 menuconfig: config/scripts/config/mconf
152         @./config/scripts/config/mconf $(CONFIG_CONFIG_IN)
153
154 config: config/scripts/config/conf
155         @./config/scripts/config/conf $(CONFIG_CONFIG_IN)
156
157 oldconfig: config/scripts/config/conf
158         @./config/scripts/config/conf -o $(CONFIG_CONFIG_IN)
159
160 default: config/scripts/config/conf
161         @./config/scripts/config/conf -d $(CONFIG_CONFIG_IN) > /dev/null
162         $(MAKE)
163
164 randconfig: config/scripts/config/conf
165         @./config/scripts/config/conf -r $(CONFIG_CONFIG_IN)
166
167 allnoconfig: config/scripts/config/conf
168         @./config/scripts/config/conf -n $(CONFIG_CONFIG_IN)
169
170 allyesconfig: config/scripts/config/conf
171         @./config/scripts/config/conf -y $(CONFIG_CONFIG_IN)
172
173 # The special win32 release configuration
174 win32releaseconf: config/scripts/config/conf
175         @./config/scripts/config/conf -D config/win32config $(CONFIG_CONFIG_IN) > /dev/null
176         $(MAKE)
177
178 # The special linux release configuration
179 linuxconf: config/scripts/config/conf
180         @./config/scripts/config/conf -D config/linuxconfig $(CONFIG_CONFIG_IN) > /dev/null
181         $(MAKE)