summaryrefslogtreecommitdiff
path: root/src/support/Makefile.tmpl
blob: f03ebf3d02744107f6bb810094efd1d9f6a0166d (plain)
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

CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
LIBS=-lap $(EXTRA_LIBS) $(LIBS1)
INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES)
LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) -L$(SRCDIR)/ap

TARGETS=htpasswd htdigest rotatelogs logresolve ab apxs

OBJS=htpasswd.o htdigest.o rotatelogs.o logresolve.o ab.o

.c.o: 
	$(CC) -c $(CFLAGS) $(INCLUDES) $<

all: $(TARGETS)

htpasswd: htpasswd.o
	$(CC) $(CFLAGS) htpasswd.o -o htpasswd $(LDFLAGS) $(LIBS)

htdigest: htdigest.o
	$(CC) $(CFLAGS) htdigest.o -o htdigest $(LDFLAGS) $(LIBS)

rotatelogs: rotatelogs.o
	$(CC) $(CFLAGS) rotatelogs.o -o rotatelogs $(LDFLAGS) $(LIBS)

logresolve: logresolve.o
	$(CC) $(CFLAGS) logresolve.o -o logresolve $(LDFLAGS) $(LIBS)

ab: ab.o
	$(CC) $(CFLAGS) ab.o -o ab $(LDFLAGS) $(LIBS)

apxs: apxs.pl
	sed <apxs.pl >apxs \
	    -e 's%@CC@%$(CC)%g' \
	    -e 's%@LD@%$(LD)%g' \
	    -e 's%@CFLAGS@%$(CFLAGS)%g' \
	    -e 's%@CFLAGS_SHLIB@%$(CFLAGS_SHLIB)%g' \
	    -e 's%@LDFLAGS_SHLIB@%$(LDFLAGS_SHLIB)%g' && chmod a+x apxs

suexec: suexec.o
	$(CC) $(CFLAGS) suexec.o -o suexec $(LDFLAGS) $(LIBS)

clean:
	rm -f $(TARGETS) *.o

distclean: clean
	-rm -f Makefile

# We really don't expect end users to use this rule.  It works only with
# gcc, and rebuilds Makefile.tmpl.  You have to re-run Configure after
# using it.
depend:
	cp Makefile.tmpl Makefile.tmpl.bak \
	    && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \
	    && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \
	    && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \
		> Makefile.tmpl \
	    && rm Makefile.new

#Dependencies

$(OBJS): Makefile

# DO NOT REMOVE
ab.o: ab.c
htdigest.o: htdigest.c ../main/md5c.c $(INCDIR)/conf.h \
 ../os/unix/os.h $(INCDIR)/hsregex.h $(INCDIR)/md5.h
htpasswd.o: htpasswd.c
logresolve.o: logresolve.c
rotatelogs.o: rotatelogs.c
suexec.o: suexec.c suexec.h