summaryrefslogtreecommitdiffstats
path: root/build/NWGNUmakefile
blob: 1954257eb57984cf3f0f8926ece6628d4539a46b (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
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
#
# Declare the sub-directories to be built here
#

SUBDIRS = \
	$(APR_WORK)/build \
	$(EOLIST) 

#
# Get the 'head' of the build environment.  This includes default targets and
# paths to tools
#

include $(AP_WORK)/build/NWGNUhead.inc

#
# build this level's files

FILES_prebuild_headers = \
	$(SRC)/include/ap_config_layout.h \
	$(NWOS)/test_char.h \
	$(PCRE)/config.h \
	$(PCRE)/pcre.h \
	$(EOLIST) 
    
nlms :: libs $(NWOS)/httpd.imp $(DAV)/main/dav.imp $(STDMOD)/cache/mod_cache.imp

libs :: chkapr $(NWOS)/chartables.c

$(DAV)/main/dav.imp : make_nw_export.awk $(DAV)/main/mod_dav.h
	@echo $(DL)GEN  $@$(DL)
	$(AWK) -v EXPPREFIX=AP$(VERSION_MAJMIN) -f $^ >$@

$(STDMOD)/cache/mod_cache.imp: make_nw_export.awk $(STDMOD)/cache/mod_cache.h $(STDMOD)/cache/cache_util.h
	@echo $(DL)GEN  $@$(DL)
	$(AWK) -v EXPPREFIX=AP$(VERSION_MAJMIN) -f $^ >$@

$(NWOS)/httpd.imp : make_nw_export.awk nw_export.i
	@echo $(DL)GEN  $@$(DL)
	$(AWK) -v EXPPREFIX=AP$(VERSION_MAJMIN) -f $^ >$@
    
nw_export.i : nw_export.inc $(FILES_prebuild_headers) cc.opt
	@echo $(DL)GEN  $@$(DL)
	$(CC) $< @cc.opt

cc.opt : NWGNUmakefile $(APBUILD)/NWGNUenvironment.inc $(APBUILD)/NWGNUtail.inc $(APBUILD)/NWGNUhead.inc
	@echo $(DL)-P$(DL)> $@
	@echo $(DL)-EP$(DL)>> $@
	@echo $(DL)-nosyspath$(DL)>> $@
	@echo $(DL)-w nocmdline$(DL)>> $@
	@echo $(DL)$(DEFINES)$(DL)>> $@
	@echo $(DL)-I$(SRC)/include$(DL)>> $@
	@echo $(DL)-I$(HTTPD)$(DL)>> $@
	@echo $(DL)-I$(STDMOD)/aaa$(DL)>> $@
	@echo $(DL)-I$(STDMOD)/core$(DL)>> $@
	@echo $(DL)-I$(NWOS)$(DL)>> $@
	@echo $(DL)-I$(SERVER)/mpm/netware$(DL)>> $@
	@echo $(DL)-I$(APR)/include$(DL)>> $@
	@echo $(DL)-I$(APRUTIL)/include$(DL)>> $@
	@echo $(DL)-ir $(NOVELLLIBC)$(DL)>> $@

$(SRC)/include/ap_config_layout.h: $(NWOS)/netware_config_layout.h
	@echo Creating $@
	$(call COPY,$<,$@)

$(PCRE)/%.h: $(PCRE)/%.h.generic
	@echo Creating $@
	$(call COPY,$<,$@)

$(PCRE)/%.h: $(PCRE)/%.hw
	@echo Creating $@
	$(call COPY,$<,$@)

ifneq "$(BUILDTOOL_AS_NLM)" "1"

$(NWOS)/chartables.c: dftables.exe $(PCRE)/dftables.c
	@echo $(DL)GEN  $@$(DL)
	$< $@

%.exe: $(PCRE)/%.c $(PCRE)/config.h $(PCRE)/pcre.h
	@echo $(DL)Creating Build Helper $@$(DL)
	$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DHAVE_CONFIG_H $< -o $@

$(NWOS)/test_char.h: gen_test_char.exe $(SERVER)/gen_test_char.c
	@echo $(DL)GEN  $@$(DL)
	$< > $@

%.exe: $(SERVER)/%.c
	@echo $(DL)Creating Build Helper $@$(DL)
	$(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DCROSS_COMPILE $< -o $@

else

ifneq "$(wildcard $(NWOS)/chartables.c)" "$(NWOS)/chartables.c"
$(error Error: required source $(NWOS)/chartables.c not found!)
endif

ifneq "$(wildcard $(NWOS)/test_char.h)" "$(NWOS)/test_char.h"
$(error Error: required header $(NWOS)/test_char.h not found!)
endif

endif

#
# Check for minimum APR version
#
chkapr: $(APR)/build/nw_ver.awk $(APR)/include/apr_version.h
	@echo $(DL)Checking for APR version...$(DL)
	$(AWK) -v WANTED=$(APR_WANTED) -f $^

#
# You can use this target if all that is needed is to copy files to the
# installation area
#
install :: nlms FORCE

clean ::
	$(call DEL,$(SRC)/include/ap_config_layout.h)
	$(call DEL,$(PCRE)/config.h)
	$(call DEL,$(PCRE)/pcre.h)
	$(call DEL,$(STDMOD)/cache/mod_cache.imp)
	$(call DEL,$(DAV)/main/dav.imp)
	$(call DEL,$(NWOS)/httpd.imp)
	$(call DEL,nw_export.i)
	$(call DEL,cc.opt)
	$(call DEL,NWGNUversion.inc)
ifneq "$(BUILDTOOL_AS_NLM)" "1"
	$(call DEL,$(NWOS)/chartables.c)
	$(call DEL,$(NWOS)/test_char.h)
	$(call DEL,dftables.exe)
	$(call DEL,gen_test_char.exe)
endif

#
# Include the 'tail' makefile that has targets that depend on variables defined
# in this makefile
#

include $(APBUILD)/NWGNUtail.inc