File: Makefile

package info (click to toggle)
twoftpd 1.42-1.2
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 700 kB
  • sloc: sh: 2,929; ansic: 2,182; makefile: 93
file content (183 lines) | stat: -rw-r--r-- 5,157 bytes parent folder | download | duplicates (2)
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
# Don't edit Makefile!  Use conf-* for configuration.
#
# Generated by spac see http://untroubled.org/spac/

SHELL=/bin/sh

DEFAULT: all

all: libraries programs docs

backend.a: makelib backend.o copy.o list.o messagefile.o path.o retr.o socket.o stat.o statmod.o state.o store.o
	./makelib backend.a backend.o copy.o list.o messagefile.o path.o retr.o socket.o stat.o statmod.o state.o store.o

backend.o: compile backend.c twoftpd.h backend.h
	./compile backend.c

banner.o: compile banner.c twoftpd.h
	./compile banner.c

clean: TARGETS
	rm -f `cat TARGETS`

clean-spac: clean AUTOFILES
	rm -f `cat AUTOFILES`

compile: conf-cc conf-bgincs
	( bgincs=`head -n 1 conf-bgincs`; \
	  echo '#!/bin/sh'; \
	  echo 'source=$$1; shift'; \
	  echo 'base=`echo "$$source" | sed -e s:\\\\.c$$::`'; \
	  echo exec `head -n 1 conf-cc` -I. "-I'$${bgincs}'" '-o $${base}.o -c $$source $${1+"$$@"}'; \
	) >compile
	chmod 755 compile

conf.o: compile conf.c conf.h
	./compile conf.c

conf_bin.c: conf-bin
	head -n 1 conf-bin | \
	  sed -e 's/"/\\"/g' \
	      -e 's/^/const char conf_bin[] = "/' \
	      -e 's/$$/";/' >conf_bin.c

copy.o: compile copy.c backend.h
	./compile copy.c

docs: twoftpd-auth.1.html twoftpd-xfer.1.html twoftpd-switch.1.html

install: INSTHIER conf-bin conf-man
	bg-installer -v <INSTHIER
	bg-installer -c <INSTHIER

libraries: backend.a main.a

list.o: compile list.c twoftpd.h backend.h
	./compile list.c

load: conf-ld conf-bglibs
	( bglibs=`head -n 1 conf-bglibs`; \
	  echo '#!/bin/sh';\
	  echo 'main="$$1"; shift';\
	  echo exec `head -n 1 conf-ld` -L. "-L'$${bglibs}'" "-Wl,-R'$${bglibs}'" '-o "$$main" "$$main.o" $${1+"$$@"}' -lbg-sysdeps; \
	) >load
	chmod 755 load

log.o: compile log.c log.h
	./compile log.c

main.a: makelib banner.o log.o main.o respond.o responses.o strtou.o
	./makelib main.a banner.o log.o main.o respond.o responses.o strtou.o

main.o: compile main.c twoftpd.h log.h
	./compile main.c

makelib: 
	( echo '#!/bin/sh'; \
	  echo 'lib="$$1"; shift';\
	  echo 'rm -f "$$lib"';\
	  echo 'ar cr "$$lib" $${1+"$$@"}';\
	  echo 'ranlib "$$lib"';\
	) >makelib
	chmod 755 makelib

messagefile.o: compile messagefile.c twoftpd.h backend.h
	./compile messagefile.c

path.o: compile path.c twoftpd.h backend.h
	./compile path.c

programs: twoftpd-xfer twoftpd-auth twoftpd-conf twoftpd-anon twoftpd-anon-conf twoftpd-switch twoftpd-bind-port twoftpd-drop

respond.o: compile respond.c twoftpd.h log.h
	./compile respond.c

responses.o: compile responses.c twoftpd.h
	./compile responses.c

retr.o: compile retr.c twoftpd.h backend.h
	./compile retr.c

socket.lib: compile load
	@echo -n 'Checking for socket libraries: '
	@echo 'main() { ; }' >trylib-lsocket.c
	@{ ./compile trylib-lsocket.c && ./load trylib-lsocket -lsocket -lnsl; } >/dev/null 2>&1 \
	  && { echo -lsocket -lnsl >socket.lib; echo -lsocket -lnsl; } \
	  || { : >socket.lib; echo no; }
	@rm -f trylib-lsocket.c trylib-lsocket.o trylib-lsocket

socket.o: compile socket.c twoftpd.h backend.h
	./compile socket.c

stat.o: compile stat.c twoftpd.h backend.h
	./compile stat.c

state.o: compile state.c twoftpd.h backend.h
	./compile state.c

statmod.o: compile statmod.c twoftpd.h backend.h
	./compile statmod.c

store.o: compile store.c twoftpd.h backend.h
	./compile store.c

strtou.o: compile strtou.c twoftpd.h
	./compile strtou.c

twoftpd-anon: twoftpd-anon.o load backend.a main.a socket.lib
	./load twoftpd-anon backend.a main.a -lbg `cat socket.lib`

twoftpd-anon-conf: twoftpd-anon-conf.o load conf.o
	./load twoftpd-anon-conf conf.o -lbg 

twoftpd-anon-conf.o: compile twoftpd-anon-conf.c conf.h conf_bin.c
	./compile twoftpd-anon-conf.c

twoftpd-anon.o: compile twoftpd-anon.c twoftpd.h backend.h
	./compile twoftpd-anon.c

twoftpd-auth: twoftpd-auth.o load main.a socket.lib
	./load twoftpd-auth main.a -lcvm-v2client -lbg `cat socket.lib`

twoftpd-auth.1.html: twoftpd-auth.1
	man2html twoftpd-auth.1 >twoftpd-auth.1.html

twoftpd-auth.o: compile twoftpd-auth.c twoftpd.h
	./compile twoftpd-auth.c

twoftpd-bind-port: twoftpd-bind-port.o load respond.o log.o
	./load twoftpd-bind-port respond.o log.o -lbg 

twoftpd-bind-port.o: compile twoftpd-bind-port.c twoftpd.h
	./compile twoftpd-bind-port.c

twoftpd-conf: twoftpd-conf.o load conf.o
	./load twoftpd-conf conf.o -lbg 

twoftpd-conf.o: compile twoftpd-conf.c conf.h conf_bin.c
	./compile twoftpd-conf.c

twoftpd-drop: twoftpd-drop.o load backend.a main.a socket.lib
	./load twoftpd-drop backend.a main.a -lbg `cat socket.lib`

twoftpd-drop.o: compile twoftpd-drop.c twoftpd.h backend.h
	./compile twoftpd-drop.c

twoftpd-switch: twoftpd-switch.o load respond.o log.o
	./load twoftpd-switch respond.o log.o -lbg 

twoftpd-switch.1.html: twoftpd-switch.1
	man2html twoftpd-switch.1 >twoftpd-switch.1.html

twoftpd-switch.o: compile twoftpd-switch.c twoftpd.h conf_bin.c
	./compile twoftpd-switch.c

twoftpd-xfer: twoftpd-xfer.o load backend.a main.a socket.lib
	./load twoftpd-xfer backend.a main.a -lbg `cat socket.lib`

twoftpd-xfer.1.html: twoftpd-xfer.1
	man2html twoftpd-xfer.1 >twoftpd-xfer.1.html

twoftpd-xfer.o: compile twoftpd-xfer.c twoftpd.h backend.h
	./compile twoftpd-xfer.c