]> andersk Git - test.git/blob - Makefile.am
Another attempt at coming up with Makefile rules that work for
[test.git] / Makefile.am
1 AM_CPPFLAGS          =
2 AM_CFLAGS            = -g -std=gnu99 -Wall
3 AM_LDFLAGS           = -g -lm
4
5 OBJCOPY             ?= objcopy
6 OBJDUMP             ?= objdump
7
8 noinst_LTLIBRARIES   = libhttp.la                                             \
9                        liblogging.la
10 noinst_DATA          = $(top_srcdir)/demo/demo.js
11 bin_PROGRAMS         = shellinaboxd
12 man_MANS             = shellinaboxd.1
13 noinst_HEADERS       = libhttp/http.h
14 dist_doc_DATA        = AUTHORS                                                \
15                        COPYING                                                \
16                        GPL-2                                                  \
17                        ChangeLog                                              \
18                        INSTALL                                                \
19                        NEWS                                                   \
20                        README                                                 \
21                        TODO                                                   \
22                        shellinabox/white-on-black.css                         \
23                        shellinabox/black-on-white.css                         \
24                        shellinabox/monochrome.css                             \
25                        shellinabox/color.css
26 EXTRA_DIST           = INSTALL.Debian                                         \
27                        README.Fedora                                          \
28                        demo/beep.wav                                          \
29                        demo/favicon.ico                                       \
30                        demo/demo.html                                         \
31                        demo/demo.js                                           \
32                        demo/demo.jspp                                         \
33                        demo/demo.xml                                          \
34                        demo/enabled.gif                                       \
35                        demo/styles.css                                        \
36                        demo/print-styles.css                                  \
37                        demo/vt100.js                                          \
38                        demo/usercss-0.css                                     \
39                        demo/usercss-1.css                                     \
40                        demo/usercss-2.css                                     \
41                        demo/usercss-3.css                                     \
42                        etc-pam.d-shellinabox-example                          \
43                        shellinabox/shellinaboxd.man.in                        \
44                        shellinabox/shell_in_a_box.js                          \
45                        shellinabox/vt100.js                                   \
46                        shellinabox/cgi-mode-example.sh                        \
47                        debian/README                                          \
48                        debian/README.available                                \
49                        debian/README.enabled                                  \
50                        debian/changelog                                       \
51                        debian/compat                                          \
52                        debian/control                                         \
53                        debian/copyright                                       \
54                        debian/docs                                            \
55                        debian/rules                                           \
56                        debian/shellinabox.default                             \
57                        debian/shellinabox.dirs                                \
58                        debian/shellinabox.init                                \
59                        debian/shellinabox.install                             \
60                        debian/shellinabox.postinst                            \
61                        debian/shellinabox.postrm                              \
62                        debian/watch
63 LIBLOGGING_INCLUDES  = logging/logging.h                                      \
64                        config.h
65 liblogging_la_SOURCES= logging/logging.c                                      \
66                        $(LIBLOGGING_INCLUDES)
67 liblogging_la_LDFLAGS= -version 1:0:0
68
69 LIBHTTP_INCLUDES     = libhttp/hashmap.h                                      \
70                        libhttp/trie.h                                         \
71                        libhttp/httpconnection.h                               \
72                        libhttp/server.h                                       \
73                        libhttp/ssl.h                                          \
74                        libhttp/url.h                                          \
75                        config.h
76 libhttp_la_SOURCES   = libhttp/hashmap.c                                      \
77                        libhttp/trie.c                                         \
78                        libhttp/httpconnection.c                               \
79                        libhttp/server.c                                       \
80                        libhttp/ssl.c                                          \
81                        libhttp/url.c                                          \
82                        $(LIBHTTP_INCLUDES)                                    \
83                        libhttp/libhttp.sym
84 libhttp_la_LDFLAGS   = -export-symbols  $(top_srcdir)/libhttp/libhttp.sym     \
85                        -version 1:0:0
86
87 shellinaboxd_SOURCES = shellinabox/shellinaboxd.c                             \
88                        shellinabox/externalfile.c                             \
89                        shellinabox/externalfile.h                             \
90                        shellinabox/launcher.c                                 \
91                        shellinabox/launcher.h                                 \
92                        shellinabox/privileges.c                               \
93                        shellinabox/privileges.h                               \
94                        shellinabox/service.c                                  \
95                        shellinabox/service.h                                  \
96                        shellinabox/session.c                                  \
97                        shellinabox/session.h                                  \
98                        shellinabox/usercss.c                                  \
99                        shellinabox/usercss.h                                  \
100                        shellinabox/cgi_root.html                              \
101                        shellinabox/root_page.html                             \
102                        shellinabox/vt100.jspp                                 \
103                        shellinabox/shell_in_a_box.jspp                        \
104                        shellinabox/styles.css                                 \
105                        shellinabox/print-styles.css                           \
106                        shellinabox/enabled.gif                                \
107                        shellinabox/favicon.ico                                \
108                        shellinabox/beep.wav                                   \
109                        config.h
110 shellinaboxd_LDADD   = liblogging.la                                          \
111                        libhttp.la
112 shellinaboxd_LDFLAGS = -static
113
114 objcopyflags         = case "$(host_cpu)" in                                  \
115                          i[0-9]86)echo '-O elf32-i386 -B i386';;              \
116                          x86_64)  echo '-O elf64-x86-64 -B i386:x86-64';;     \
117                          *)       trap 'rm -f /tmp/probe$$$$.o' EXIT;         \
118                                   $(CC) $(AM_CFLAGS) $(CFLAGS) -c -xc         \
119                                         -o /tmp/probe$$$$.o /dev/null &&      \
120                                   $(OBJDUMP) -f /tmp/probe$$$$.o |            \
121                                   sed -e 's/.*file format */-O /;t;           \
122                                        s/architecture: *\([^,]*\).*/-B \1/;t; \
123                                        d';;                                   \
124                        esac
125
126 renamesymbols        =                                                        \
127   sed -e 's/\(.*\/\)\([^.]*\)\([.].*\)/\1\2\3=\2 /'                           \
128       -e 't0'                                                                 \
129       -e 's/\([^.]*\)\([.].*\)/\1\2=\1 /'                                     \
130       -e 't0'                                                                 \
131       -e 's/.*/&=& /'                                                         \
132       -e ':0'                                                                 \
133       -e 's/$$/aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ/'         \
134       -e ':1'                                                                 \
135       -e 's/\(=[^-_]*\)[-_]\([a-z]\)\([^ ]* .*\2\)\(.\)/\1\4\3\4/'            \
136       -e 't1'                                                                 \
137       -e 's/.\{53\}$$//'                                                      \
138       -e 's/[-/.]/_/g'                                                        \
139       -e 's/^/--redefine-sym _binary_/'                                       \
140       -e 's/\([^=]*\)\(=[^ ]*\)/& \1_end\2End/'                               \
141       -e 's/\([^=]*\)\(=[^ ]*\)/& \1_start\2Start/'                           \
142       -e 's/[^ ]*\([^=]*\)=[^ ]*/-N\1_size/'
143
144 libtool: $(LIBTOOL_DEPS)
145         $(SHELL) ./config.status --recheck
146
147
148 ${top_srcdir}/demo/demo.js: ${top_srcdir}/demo/beep.wav                       \
149                             ${top_srcdir}/demo/demo.jspp                      \
150                             ${top_srcdir}/demo/favicon.ico                    \
151                             ${top_srcdir}/demo/styles.css                     \
152                             ${top_srcdir}/demo/print-styles.css               \
153                             ${top_srcdir}/demo/vt100.js                       \
154                             ${top_srcdir}/demo/usercss-0.css                  \
155                             ${top_srcdir}/demo/usercss-1.css                  \
156                             ${top_srcdir}/demo/usercss-2.css                  \
157                             ${top_srcdir}/demo/usercss-3.css
158
159 ${top_srcdir}/demo/beep.wav: ${top_srcdir}/shellinabox/beep.wav
160         @rm -f "$@"
161         ln "$?" "$@"
162
163 ${top_srcdir}/demo/enabled.gif: ${top_srcdir}/shellinabox/enabled.gif
164         @rm -f "$@"
165         ln "$?" "$@"
166
167 ${top_srcdir}/demo/favicon.ico: ${top_srcdir}/shellinabox/favicon.ico
168         @rm -f "$@"
169         ln "$?" "$@"
170
171 ${top_srcdir}/demo/styles.css: ${top_srcdir}/shellinabox/styles.css
172         @rm -f "$@"
173         sed -e '/\[if DEFINES_COLORS\]/,/\[endif DEFINES_COLORS\]/d' "$?" >"$@"
174
175 ${top_srcdir}/demo/print-styles.css: ${top_srcdir}/shellinabox/print-styles.css
176         @rm -f "$@"
177         ln "$?" "$@"
178
179 ${top_srcdir}/demo/usercss-0.css: ${top_srcdir}/shellinabox/white-on-black.css
180         @rm -f "$@"
181         ln "$?" "$@"
182
183 ${top_srcdir}/demo/usercss-1.css: ${top_srcdir}/shellinabox/black-on-white.css
184         @rm -f "$@"
185         ln "$?" "$@"
186
187 ${top_srcdir}/demo/usercss-2.css: ${top_srcdir}/shellinabox/monochrome.css
188         @rm -f "$@"
189         ln "$?" "$@"
190
191 ${top_srcdir}/demo/usercss-3.css: ${top_srcdir}/shellinabox/color.css
192         @rm -f "$@"
193         ln "$?" "$@"
194
195 ${top_srcdir}/demo/vt100.js: ${top_srcdir}/shellinabox/vt100.js
196         @rm -f "$@"
197         ln "$?" "$@"
198
199 shellinaboxd.1: shellinabox/shellinaboxd.man.in config.h
200         @src="${top_srcdir}/shellinabox/shellinaboxd.man.in";                 \
201         echo preprocess  "$$src" '>'"$@";                                     \
202         if sed -e 's/^#define \([^ ]*\).*/\1/' -e t -e d config.h |           \
203              grep 'HAVE_BIN_LOGIN' >/dev/null 2>&1; then                      \
204           sed -e '/^#ifndef  *HAVE_BIN_LOGIN$$/,/^#endif$$/d' "$$src";        \
205         else                                                                  \
206           sed -e '/^#ifdef  *HAVE_BIN_LOGIN$$/,/^#endif$$/d' "$$src";         \
207         fi |                                                                  \
208         if [ `sed -e 's/^#define \([^ ]*\).*/\1/' -e t -e d config.h |        \
209              egrep 'HAVE_OPENSSL_BIO_H|HAVE_OPENSSL_ERR_H|HAVE_OPENSSL_SSL_H'|\
210              wc -l` -eq 3 ]; then                                             \
211           sed -e '/^#ifndef  *HAVE_OPENSSL$$/,/^#endif$$/d';                  \
212         else                                                                  \
213           sed -e '/^#ifdef  *HAVE_OPENSSL$$/,/^#endif$$/d';                   \
214         fi |                                                                  \
215         if sed -e 's/^#define \([^ ]*\).*/\1/' -e t -e d config.h |           \
216              grep 'HAVE_SECURITY_PAM_APPL_H' >/dev/null 2>&1; then            \
217           sed -e '/^#ifndef  *HAVE_PAM$$/,/^#endif$$/d';                      \
218         else                                                                  \
219           sed -e '/^#ifdef  *HAVE_PAM$$/,/^#endif$$/d';                       \
220         fi |                                                                  \
221         if [ -n "${DPKGBUILD}" ]; then                                        \
222           sed -e '/^#ifndef  *DPKGBUILD$$/,/^#endif$$/d';                     \
223         else                                                                  \
224           sed -e '/^#ifdef  *DPKGBUILD$$/,/^#endif$$/d';                      \
225         fi |                                                                  \
226         sed -e '/^#/d' >"$@"
227         @out=`echo "$@" 2>/dev/null|sed -e 's/\.[^.]*$$/.ps/'`;               \
228         man -Tps "./$@" >"$${out}" 2>/dev/null || rm -f "$${out}"
229
230 clean-local:
231         -rm -rf shellinaboxd.1                                                \
232                 shellinaboxd.ps
233         -rm -rf debian/shellinabox                                            \
234                 debian/shellinabox*.debhelper*                                \
235                 debian/shellinabox.substvars                                  \
236                 debian/tmp
237         -rm -rf GNU-stack
238
239 .css.o:
240         @echo $(OBJCOPY) "$<" "$@"
241         @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
242           "$<" "$@"
243         @-printf '\000' >GNU-stack &&                                         \
244           $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@";            \
245           rm -f GNU-stack
246
247 .gif.o:
248         @echo $(OBJCOPY) "$<" "$@"
249         @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
250           "$<" "$@"
251         @-printf '\000' >GNU-stack &&                                         \
252           $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@";            \
253           rm -f GNU-stack
254
255
256 .html.o:
257         @echo $(OBJCOPY) "$<" "$@"
258         @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
259           "$<" "$@"
260         @-printf '\000' >GNU-stack &&                                         \
261           $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@";            \
262           rm -f GNU-stack
263
264
265 .ico.o:
266         @echo $(OBJCOPY) "$<" "$@"
267         @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
268           "$<" "$@"
269         @-printf '\000' >GNU-stack &&                                         \
270           $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@";            \
271           rm -f GNU-stack
272
273
274 shellinabox/shell_in_a_box.o: shellinabox/shell_in_a_box.js config.h
275
276 .jspp.js:
277         @echo preprocess "$<" "$@"
278         @sed -e "`sed -e 's/^#define *\([^ ]*\) *\(.*\)/\/^[^#]\/s\/\1\/\2 \\\\\/* \1 *\\\\\/\/g/' \
279                      -e t                                                     \
280                      -e d "$<"`"                                              \
281              -e "s/^#/\/\/ #/"                                                \
282              -e "s/VERSION/\"@VERSION@ (revision @VCS_REVISION@)\"/g"         \
283              "$<" >"$@"
284
285 .js.o:
286         @echo $(OBJCOPY) "$<" "$@"
287         @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
288           "$<" "$@"
289         @-printf '\000' >GNU-stack &&                                         \
290           $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@";            \
291           rm -f GNU-stack
292
293
294 .wav.o:
295         @echo $(OBJCOPY) "$<" "$@"
296         @$(OBJCOPY) -I binary `$(objcopyflags)` `echo "$<" | $(renamesymbols)`\
297           "$<" "$@"
298         @-printf '\000' >GNU-stack &&                                         \
299           $(OBJCOPY) --add-section .note.GNU-stack=GNU-stack "$@";            \
300           rm -f GNU-stack
301
302
This page took 0.056274 seconds and 5 git commands to generate.