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

SUBDIRS = \
	$(EOLIST) 

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

include $(APR_WORK)\build\NWGNUhead.inc

#
# build this level's files

FILES_prebuild_headers = \
	$(APR)/include/apr.h \
	$(APRUTIL)/include/apu.h \
	$(APRUTIL)/include/apu_want.h \
	$(APRUTIL)/include/apr_ldap.h \
	$(APRUTIL)/include/private/apu_config.h \
	$(APRUTIL)/include/private/apu_select_dbm.h \
	$(APRUTIL)/xml/expat/lib/expat_config.h \
	$(APRUTIL)/uri/uri_delims.h \
	$(EOLIST) 

nlms :: $(APR)/aprlib.imp

$(APR)/aprlib.imp : make_nw_export.awk nw_export.i
	@echo Generating $(subst /,\,$@)
	awk -f make_nw_export.awk nw_export.i | sort >$(APR)/aprlib.imp
    
nw_export.i : nw_export.inc $(FILES_prebuild_headers) $(NLM_NAME)_cc.opt
	@echo Generating $(subst /,\,$@)
	$(CC) $< @$(NLM_NAME)_cc.opt

$(NLM_NAME)_cc.opt : NWGNUmakefile $(APR_WORK)\build\NWGNUenvironment.inc $(APR_WORK)\build\NWGNUhead.inc $(APR_WORK)\build\NWGNUtail.inc $(CUSTOM_INI)
	$(CHK) $@ $(DEL) $@
	@echo -P >> $@
	@echo -EP >> $@
	@echo -nosyspath >> $@
	@echo -w nocmdline >> $@
	@echo -DNETWARE >> $@
	@echo -I..\include >> $@
	@echo -I..\include\arch\netware >> $@
	@echo -I..\include\arch\unix >> $@
	@echo -I$(APRUTIL)\include >> $@
	@echo -ir $(NOVELLLIBC)\include >> $@

$(APR)/include/%.h: $(subst /,\,$(APR))\include\%.hnw
	@echo Creating $(subst /,\,$@)
	copy $< $(subst /,\,$(APR))\include\$(@F)

$(APRUTIL)/include/%.h: $(subst /,\,$(APRUTIL))\include\%.hnw
	@echo Creating $(subst /,\,$@)
	copy $< $(subst /,\,$(APRUTIL))\include\$(@F)

$(APRUTIL)/include/private/%.h: $(subst /,\,$(APRUTIL))\include\private\%.hw
	@echo Creating $(subst /,\,$@)
	copy $< $(subst /,\,$(APRUTIL))\include\private\$(@F)

$(APRUTIL)/xml/expat/lib/%.h: $(subst /,\,$(APRUTIL))\xml\expat\lib\%.hnw
	@echo Creating $(subst /,\,$@)
	copy $< $(subst /,\,$(APRUTIL))\xml\expat\lib\$(@F)

ifneq "$(BUILDTOOL_AS_NLM)" "1"

$(APRUTIL)/uri/uri_delims.h: gen_uri_delims.exe $(APRUTIL)/uri/gen_uri_delims.c
	@echo Creating $(subst /,\,$@)
	@$< > $@

%.exe: $(APRUTIL)/uri/%.c
	@echo Creating $@
	@$(WIN_CC) $(WIN_CFLAGS) $< -o $@

else

ifneq "$(wildcard $(APRUTIL)/uri/uri_delims.h)" "$(APRUTIL)/uri/uri_delims.h"
$(error Error: required header $(abspath $(APRUTIL)/uri/uri_delims.h) not found!)
endif

endif

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

clean ::
	$(CHK) nw_export.i                                              $(DEL) nw_export.i
	$(CHK) $(NLM_NAME)_cc.opt                                       $(DEL) $(NLM_NAME)_cc.opt
	$(CHK) NWGNUversion.inc                                         $(DEL) NWGNUversion.inc	
	$(CHK) $(subst /,\,$(APR))\include\apr.h                        $(DEL) $(subst /,\,$(APR))\include\apr.h
	$(CHK) $(subst /,\,$(APRUTIL))\include\apu.h                    $(DEL) $(subst /,\,$(APRUTIL))\include\apu.h
	$(CHK) $(subst /,\,$(APRUTIL))\include\apr_ldap.h               $(DEL) $(subst /,\,$(APRUTIL))\include\apr_ldap.h
	$(CHK) $(subst /,\,$(APRUTIL))\include\private\apu_config.h     $(DEL) $(subst /,\,$(APRUTIL))\include\private\apu_config.h
	$(CHK) $(subst /,\,$(APRUTIL))\include\private\apu_select_dbm.h $(DEL) $(subst /,\,$(APRUTIL))\include\private\apu_select_dbm.h
	$(CHK) $(subst /,\,$(APRUTIL))\xml\expat\lib\expat_config.h     $(DEL) $(subst /,\,$(APRUTIL))\xml\expat\lib\expat_config.h
	$(CHK) $(subst /,\,$(APR))\aprlib.imp                           $(DEL) $(subst /,\,$(APR))\aprlib.imp
ifneq "$(BUILDTOOL_AS_NLM)" "1"
	$(CHK) $(subst /,\,$(APRUTIL))\uri\uri_delims.h                 $(DEL) $(subst /,\,$(APRUTIL))\uri\uri_delims.h
	$(CHK) gen_uri_delims.exe                                       $(DEL) gen_uri_delims.exe
endif