File: Makefile.tmpl

package info (click to toggle)
apache 1.3.3-7
  • links: PTS
  • area: main
  • in suites: slink
  • size: 6,508 kB
  • ctags: 6,595
  • sloc: ansic: 50,060; sh: 3,776; perl: 1,354; makefile: 234; cpp: 55
file content (121 lines) | stat: -rw-r--r-- 4,054 bytes parent folder | download
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

CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS)
LIBS=$(EXTRA_LIBS) $(LIBS1)
INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES)
LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS)

OBJS= \
  modules.o \
  $(MODULES) \
  main/libmain.a \
  $(OSDIR)/libos.a \
  ap/libap.a

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

all: @@Configuration@@ $(TARGET)

@@Configuration@@: Configuration.tmpl
	@echo "++ File '@@Configuration@@' older than 'Configuration.tmpl',"
	@echo "++ or still doesn't exist. Please consider copying 'Configuration.tmpl'"
	@echo "++ to '@@Configuration@@', editing and rerunning 'Configure'."
	@echo "++ If not, you will at least have to touch '@@Configuration@@'."
	@false

$(TARGET): $(EXTRA_DEPS) $(SUBTARGET)

target_static: subdirs modules.o
	$(CC) -c $(INCLUDES) $(CFLAGS) buildmark.c
	$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
	      -o $(TARGET) buildmark.o $(OBJS) $(REGLIB) $(LIBS)

target_shared: libhttpd.ep
	$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
	      -o $(TARGET) -DSHARED_CORE_BOOTSTRAP main/http_main.c

libhttpd.ep: libhttpd.$(SHLIB_SUFFIX_NAME)
	$(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
	      -o libhttpd.ep -DSHARED_CORE_TIESTATIC main/http_main.c \
		  -L. -lhttpd $(LIBS)

libhttpd.$(SHLIB_SUFFIX_NAME): subdirs modules.o
	$(CC) -c $(INCLUDES) $(CFLAGS) buildmark.c
	$(LD_SHLIB) $(LDFLAGS_SHLIB) -o libhttpd.$(SHLIB_SUFFIX_NAME) buildmark.o $(OBJS) $(REGLIB)
	@if [ ".$(SHLIB_SUFFIX_LIST)" != . ]; then \
		rm -f libhttpd.$(SHLIB_SUFFIX_NAME).*; \
		for suffix in $(SHLIB_SUFFIX_LIST) ""; do \
			[ ".$$suffix" = . ] && continue; \
		    echo "ln libhttpd.$(SHLIB_SUFFIX_NAME) libhttpd.$(SHLIB_SUFFIX_NAME).$$suffix"; \
		    ln libhttpd.$(SHLIB_SUFFIX_NAME) libhttpd.$(SHLIB_SUFFIX_NAME).$$suffix; \
		done; \
	fi

subdirs:
	@for i in $(SUBDIRS); do \
		echo "===> $(SDP)$$i"; \
		( cd $$i && $(MAKE) $(MFLAGS_STATIC) SDP='$(SDP)' CC='$(CC)' AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)') || exit 1; \
		echo "<=== $(SDP)$$i"; \
	done

support: support-dir

support-dir:
	@echo "===> $(SDP)support"; \
	cd support; $(MAKE) $(MFLAGS_STATIC) SDP='$(SDP)' CC='$(CC)' AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)'; \
	echo "<=== $(SDP)support"

clean:
	-rm -f $(TARGET) libhttpd.* *.o
	@for i in $(SUBDIRS); do \
		echo "===> $(SDP)$$i"; \
		( cd $$i && $(MAKE) $(MFLAGS_STATIC) SDP='$(SDP)' $@ ) || exit 1; \
		echo "<=== $(SDP)$$i"; \
	done

distclean:
	-rm -f $(TARGET) libhttpd.* *.o
	@for i in $(SUBDIRS); do \
		echo "===> $(SDP)$$i"; \
		( cd $$i && $(MAKE) $(MFLAGS_STATIC) SDP='$(SDP)' $@ ) || exit 1; \
		echo "<=== $(SDP)$$i"; \
	done
	-rm -f include/ap_config_auto.h
	-rm -f modules.c
	-rm -f modules/Makefile
	-rm -f regex/Makefile
	-rm -f Makefile.config
	-rm -f Makefile

install:
	@echo "++ Sorry, no installation procedure available at this level."
	@echo "++ Go to the parent directory for an 'install' target."

# 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' \
	           -e '1,$$s: $(OSDIR)/: $$(OSDIR)/:g' Makefile.new \
		> Makefile.tmpl \
	    && rm Makefile.new
	for i in $(SUBDIRS); do \
	    ( cd $$i && $(MAKE) CC='$(CC)' AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)' depend ) || exit 1; \
	done

#Dependencies

$(OBJS): Makefile subdirs

# DO NOT REMOVE
buildmark.o: buildmark.c include/ap_config.h include/ap_mmn.h \
 include/ap_config_auto.h os/unix/os.h include/ap_ctype.h \
 include/hsregex.h include/httpd.h include/alloc.h include/buff.h \
 include/ap.h include/util_uri.h
modules.o: modules.c include/httpd.h include/ap_config.h \
 include/ap_mmn.h include/ap_config_auto.h os/unix/os.h \
 include/ap_ctype.h include/hsregex.h include/alloc.h include/buff.h \
 include/ap.h include/util_uri.h include/http_config.h