Blame build/NWGNUtail.inc

Packit 90a5c9
#
Packit 90a5c9
# This contains final targets and should be included at the end of any
Packit 90a5c9
# NWGNUmakefile file
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# If we are going to create an nlm, make sure we have assigned variables to
Packit 90a5c9
# use during the link.
Packit 90a5c9
#
Packit 90a5c9
ifndef NLM_NAME
Packit 90a5c9
NLM_NAME = $(TARGET_nlm)
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifndef NLM_DESCRIPTION
Packit 90a5c9
NLM_DESCRIPTION = $(NLM_NAME)
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifndef NLM_THREAD_NAME
Packit 90a5c9
NLM_THREAD_NAME = $(NLM_NAME) Thread
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifndef NLM_SCREEN_NAME
Packit 90a5c9
NLM_SCREEN_NAME = DEFAULT
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifndef NLM_COPYRIGHT
Packit 90a5c9
NLM_COPYRIGHT = Licensed under the Apache License, Version 2.0
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifeq "$(NLM_FLAGS)" ""
Packit 90a5c9
NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifeq "$(NLM_STACK_SIZE)" ""
Packit 90a5c9
NLM_STACK_SIZE = 65536
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifeq "$(NLM_ENTRY_SYM)" ""
Packit 90a5c9
NLM_ENTRY_SYM = _LibCPrelude
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifeq "$(NLM_EXIT_SYM)" ""
Packit 90a5c9
NLM_EXIT_SYM = _LibCPostlude
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifeq "$(NLM_VERSION)" ""
Packit 90a5c9
NLM_VERSION = $(VERSION)
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Create dependency lists based on the files available
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
STANDARD_DEPENDS	= \
Packit 90a5c9
				$(APBUILD)/NWGNUhead.inc \
Packit 90a5c9
				$(APBUILD)/NWGNUenvironment.inc \
Packit 90a5c9
				$(APBUILD)/NWGNUtail.inc \
Packit 90a5c9
				$(CUSTOM_INI) \
Packit 90a5c9
				$(EOLIST)
Packit 90a5c9
Packit 90a5c9
CCOPT_DEPENDS	= $(STANDARD_DEPENDS)
Packit 90a5c9
Packit 90a5c9
$(NLM_NAME)_LINKOPT_DEPENDS	= \
Packit 90a5c9
				$(TARGET_lib) \
Packit 90a5c9
				$(STANDARD_DEPENDS) \
Packit 90a5c9
				$(VERSION_INC) \
Packit 90a5c9
				$(EOLIST)
Packit 90a5c9
Packit 90a5c9
ifeq "$(words $(strip $(TARGET_lib)))" "1"
Packit 90a5c9
LIB_NAME			= $(basename $(notdir $(TARGET_lib)))
Packit 90a5c9
$(LIB_NAME)_LIBLST_DEPENDS	= \
Packit 90a5c9
				$(FILES_lib_objs) \
Packit 90a5c9
				$(STANDARD_DEPENDS) \
Packit 90a5c9
				$(CUSTOM_INI) \
Packit 90a5c9
				$(EOLIST)
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifeq "$(wildcard NWGNU$(LIB_NAME))" "NWGNU$(LIB_NAME)"
Packit 90a5c9
$(LIB_NAME)_LIBLST_DEPENDS	+= NWGNU$(LIB_NAME)
Packit 90a5c9
CCOPT_DEPENDS	+= NWGNU$(LIB_NAME)
Packit 90a5c9
else
Packit 90a5c9
CCOPT_DEPENDS	+= NWGNUmakefile
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
ifeq "$(wildcard NWGNU$(NLM_NAME))" "NWGNU$(NLM_NAME)"
Packit 90a5c9
$(NLM_NAME)_LINKOPT_DEPENDS	+= NWGNU$(NLM_NAME)
Packit 90a5c9
CCOPT_DEPENDS	+= NWGNU$(NLM_NAME)
Packit 90a5c9
else
Packit 90a5c9
CCOPT_DEPENDS	+= NWGNUmakefile
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
CPPOPT_DEPENDS	= $(CCOPT_DEPENDS)
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Generic compiler rules
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
ifneq "$(MAKECMDGOALS)" "clean"
Packit 90a5c9
ifneq "$(findstring clobber_,$(MAKECMDGOALS))" "clobber_"
Packit 90a5c9
$(APBUILD)/NWGNUversion.inc: $(APBUILD)/nw_ver.awk $(SRC)/include/ap_release.h
Packit 90a5c9
	@echo $(DL)GEN  $@$(DL)
Packit 90a5c9
	$(AWK) -f $^ $(SRC)/.svn/all-wcprops > $@
Packit 90a5c9
Packit 90a5c9
-include $(APBUILD)/NWGNUversion.inc
Packit 90a5c9
Packit 90a5c9
ifneq "$(strip $(VERSION_STR))" ""
Packit 90a5c9
VERSION_INC = $(APBUILD)/NWGNUversion.inc
Packit 90a5c9
else
Packit 90a5c9
VERSION		= 2,4,0
Packit 90a5c9
VERSION_STR	= 2.4.0
Packit 90a5c9
VERSION_MAJMIN	= 24
Packit 90a5c9
endif
Packit 90a5c9
endif
Packit 90a5c9
endif
Packit 90a5c9
ifeq "$(USE_SVNREV)" "1"
Packit 90a5c9
ifneq "$(strip $(SVN_REVISION))" ""
Packit 90a5c9
CFLAGS	+= -DAP_SERVER_ADD_STRING=\"$(SVN_REVISION)\"
Packit 90a5c9
endif
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
ifeq "$(words $(strip $(TARGET_nlm)))" "1"
Packit 90a5c9
Packit 90a5c9
$(OBJDIR)/%.o: %.c $(OBJDIR)/$(NLM_NAME)_cc.opt
Packit 90a5c9
	@echo $(DL)CC   $<$(DL)
Packit 90a5c9
	$(CC) -o $@ $< @$(word 2, $^)
Packit 90a5c9
Packit 90a5c9
$(OBJDIR)/$(NLM_NAME)_cc.opt: $(CCOPT_DEPENDS)
Packit 90a5c9
	$(call DEL,$@)
Packit 90a5c9
	@echo $(DL)GEN  $@$(DL)
Packit 90a5c9
ifneq "$(strip $(CFLAGS))" ""
Packit 90a5c9
	@echo $(DL)$(CFLAGS)$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(strip $(XCFLAGS))" ""
Packit 90a5c9
	@echo $(DL)$(XCFLAGS)$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(strip $(XINCDIRS))" ""
Packit 90a5c9
	@echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(strip $(INCDIRS))" ""
Packit 90a5c9
	@echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(strip $(DEFINES))" ""
Packit 90a5c9
	@echo $(DL)$(DEFINES)$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(strip $(XDEFINES))" ""
Packit 90a5c9
	@echo $(DL)$(XDEFINES)$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
$(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(NLM_NAME)_cpp.opt
Packit 90a5c9
	@echo $(DL)CC   $<$(DL)
Packit 90a5c9
	$(CC) -o $@ $< @$(word 2, $^)
Packit 90a5c9
Packit 90a5c9
$(OBJDIR)/$(NLM_NAME)_cpp.opt: $(CPPOPT_DEPENDS)
Packit 90a5c9
	$(call DEL,$@)
Packit 90a5c9
	@echo $(DL)GEN  $@$(DL)
Packit 90a5c9
ifneq "$(strip $(CFLAGS))" ""
Packit 90a5c9
	@echo $(DL)$(CFLAGS)$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(strip $(XCFLAGS))" ""
Packit 90a5c9
	@echo $(DL)$(XCFLAGS)$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(strip $(XINCDIRS))" ""
Packit 90a5c9
	@echo $(DL)$(foreach xincdir,$(strip $(subst ;,$(SPACE),$(XINCDIRS))),-I$(xincdir))$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(strip $(INCDIRS))" ""
Packit 90a5c9
	@echo $(DL)$(foreach incdir,$(strip $(subst ;,$(SPACE),$(INCDIRS))),-I$(incdir))$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(strip $(DEFINES))" ""
Packit 90a5c9
	@echo $(DL)$(DEFINES)$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(strip $(XDEFINES))" ""
Packit 90a5c9
	@echo $(DL)$(XDEFINES)$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
endif # one target nlm
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Rules to build libraries
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
# If we only have one target library then build it
Packit 90a5c9
Packit 90a5c9
ifeq "$(words $(strip $(TARGET_lib)))" "1"
Packit 90a5c9
Packit 90a5c9
$(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst
Packit 90a5c9
	$(call DEL,$@)
Packit 90a5c9
	@echo $(DL)AR   $@$(DL)
Packit 90a5c9
	$(LIB) -o $@ @$<
Packit 90a5c9
Packit 90a5c9
$(OBJDIR)/$(LIB_NAME)_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS)
Packit 90a5c9
	$(call DEL,$@)
Packit 90a5c9
ifneq "$(strip $(FILES_lib_objs))" ""
Packit 90a5c9
	@echo $(DL)GEN  $@$(DL)
Packit 90a5c9
	@echo $(DL)$(FILES_lib_objs)$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
else # We must have more than one target library so load the individual makefiles
Packit 90a5c9
Packit 90a5c9
$(OBJDIR)/%.lib: NWGNU% $(STANDARD_DEPENDS) FORCE
Packit 90a5c9
	@echo $(DL)Calling $<$(DL)
Packit 90a5c9
	$(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE)
Packit 90a5c9
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
#
Packit 90a5c9
# Rules to build nlms.
Packit 90a5c9
#
Packit 90a5c9
Packit 90a5c9
# If we only have one target NLM then build it
Packit 90a5c9
ifeq "$(words $(strip $(TARGET_nlm)))" "1"
Packit 90a5c9
Packit 90a5c9
$(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt
Packit 90a5c9
	@echo $(DL)LINK $@$(DL)
Packit 90a5c9
	$(LINK) @$(OBJDIR)/$(NLM_NAME)_link.opt
Packit 90a5c9
Packit 90a5c9
# This will force the link option file to be rebuilt if we change the
Packit 90a5c9
# corresponding makefile
Packit 90a5c9
Packit 90a5c9
$(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS)
Packit 90a5c9
	$(call DEL,$@)
Packit 90a5c9
	$(call DEL,$(@:.opt=.def))
Packit 90a5c9
	@echo $(DL)GEN  $@$(DL)
Packit 90a5c9
	@echo $(DL)-nlmversion=$(NLM_VERSION)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-warnings off$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-zerobss$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-o $(TARGET_nlm)$(DL)>> $@
Packit 90a5c9
ifneq "$(FILE_nlm_copyright)" ""
Packit 90a5c9
	@$(CAT) $(FILE_nlm_copyright)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifeq "$(RELEASE)" "debug"
Packit 90a5c9
	@echo $(DL)-g$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-sym internal$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-sym codeview4$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-osym $(OBJDIR)/$(NLM_NAME).sym$(DL)>> $@
Packit 90a5c9
else
Packit 90a5c9
	@echo $(DL)-sym internal$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
	@echo $(DL)-l $(SRC)/$(OBJDIR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l $(HTTPD)/$(OBJDIR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l $(SERVER)/$(OBJDIR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l $(STDMOD)/$(OBJDIR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l $(NWOS)/$(OBJDIR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l $(NWOS)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l $(APR)/$(OBJDIR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l $(APR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l $(APRUTIL)/$(OBJDIR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l $(PCRE)/$(OBJDIR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/Runtime"$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l "$(METROWERKS)/Novell Support/Metrowerks Support/Libraries/MSL C++"$(DL)>> $@
Packit 90a5c9
ifneq "$(IPV6)" ""
Packit 90a5c9
	@echo $(DL)-l $(NOVELLLIBC)/include/winsock/IPV6$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
	@echo $(DL)-l $(NOVELLLIBC)/imports$(DL)>> $@
Packit 90a5c9
ifneq "$(LDAPSDK)" ""
Packit 90a5c9
	@echo $(DL)-l $(LDAPSDK)/imports$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
	@echo $(DL)-l $(APULDAP)/$(OBJDIR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l $(XML)/$(OBJDIR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-l $(SRC)/$(OBJDIR)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-nodefaults$(DL)>> $@
Packit 90a5c9
	@echo $(DL)-map $(OBJDIR)/$(NLM_NAME).map$(DL)>> $@
Packit 90a5c9
ifneq "$(strip $(XLFLAGS))" ""
Packit 90a5c9
	@echo $(DL)$(XLFLAGS)$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(strip $(FILES_nlm_objs))" ""
Packit 90a5c9
	@echo $(DL)$(foreach objfile,$(strip $(FILES_nlm_objs)),$(objfile))$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(FILES_nlm_libs)" ""
Packit 90a5c9
	@echo $(DL)$(foreach libfile, $(notdir $(strip $(FILES_nlm_libs))),-l$(libfile))$(DL)>> $@
Packit 90a5c9
endif
Packit 90a5c9
	@echo $(DL)-commandfile $(@:.opt=.def)$(DL)>> $@
Packit 90a5c9
	@echo $(DL)# Do not edit this file - it is created by make!$(DL)> $(@:.opt=.def) 
Packit 90a5c9
	@echo $(DL)# All your changes will be lost!!$(DL)>> $(@:.opt=.def) 
Packit 90a5c9
ifneq "$(FILE_nlm_msg)" ""
Packit 90a5c9
	@echo $(DL)Messages $(FILE_nlm_msg)$(DL)>> $(@:.opt=.def)
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(FILE_nlm_hlp)" ""
Packit 90a5c9
	@echo $(DL)Help $(FILE_nlm_hlp)$(DL)>> $(@:.opt=.def)
Packit 90a5c9
endif
Packit 90a5c9
ifeq "$(FILE_nlm_copyright)" ""
Packit 90a5c9
	@echo $(DL)copyright "$(NLM_COPYRIGHT)"$(DL)>> $(@:.opt=.def)
Packit 90a5c9
endif
Packit 90a5c9
	@echo $(DL)description "$(NLM_DESCRIPTION)"$(DL)>> $(@:.opt=.def)
Packit 90a5c9
	@echo $(DL)threadname "$(NLM_THREAD_NAME)"$(DL)>> $(@:.opt=.def)
Packit 90a5c9
	@echo $(DL)screenname "$(NLM_SCREEN_NAME)"$(DL)>> $(@:.opt=.def)
Packit 90a5c9
	@echo $(DL)stacksize $(subst K,000,$(subst k,K,$(strip $(NLM_STACK_SIZE))))$(DL)>> $(@:.opt=.def)
Packit 90a5c9
#	@echo $(DL)version $(NLM_VERSION) $(DL)>> $(@:.opt=.def)
Packit 90a5c9
	@echo $(DL)start $(NLM_ENTRY_SYM)$(DL)>> $(@:.opt=.def)
Packit 90a5c9
	@echo $(DL)exit $(NLM_EXIT_SYM)$(DL)>> $(@:.opt=.def)
Packit 90a5c9
ifneq "$(NLM_CHECK_SYM)" ""
Packit 90a5c9
	@echo $(DL)check $(NLM_CHECK_SYM)$(DL)>> $(@:.opt=.def)
Packit 90a5c9
endif
Packit 90a5c9
	@echo $(DL)$(strip $(NLM_FLAGS))$(DL)>> $(@:.opt=.def)
Packit 90a5c9
ifneq "$(FILES_nlm_modules)" ""
Packit 90a5c9
	@echo $(DL)module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module))$(DL)>> $(@:.opt=.def)
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(FILES_nlm_Ximports)" ""
Packit 90a5c9
	@echo $(DL)import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(import))$(DL)>> $(@:.opt=.def)
Packit 90a5c9
endif
Packit 90a5c9
ifneq "$(FILES_nlm_exports)" ""
Packit 90a5c9
	@echo $(DL)export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export))$(DL)>> $(@:.opt=.def)
Packit 90a5c9
endif
Packit 90a5c9
# if APACHE_UNIPROC is defined, don't include XDCData
Packit 90a5c9
ifndef APACHE_UNIPROC
Packit 90a5c9
ifneq "$(string $(XDCDATA))" ""
Packit 90a5c9
	@echo $(DL)xdcdata $(XDCDATA)$(DL)>> $(@:.opt=.def)
Packit 90a5c9
else
Packit 90a5c9
	@echo $(DL)xdcdata apache.xdc$(DL)>> $(@:.opt=.def)
Packit 90a5c9
endif
Packit 90a5c9
endif
Packit 90a5c9
Packit 90a5c9
else # more than one target so look for individual makefiles.
Packit 90a5c9
Packit 90a5c9
# Only include these if NO_LICENSE_FILE isn't set to prevent excessive
Packit 90a5c9
# recursion
Packit 90a5c9
Packit 90a5c9
ifndef NO_LICENSE_FILE
Packit 90a5c9
Packit 90a5c9
$(OBJDIR)/%.nlm: NWGNU% $($(NLM_NAME)_LINKOPT_DEPENDS) FORCE
Packit 90a5c9
	@echo $(DL)Calling $<$(DL)
Packit 90a5c9
	$(MAKE) -f $< $(MAKECMDGOALS) RELEASE=$(RELEASE)
Packit 90a5c9
	@$(ECHONL)
Packit 90a5c9
Packit 90a5c9
else
Packit 90a5c9
Packit 90a5c9
$(TARGET_nlm):
Packit 90a5c9
Packit 90a5c9
endif # NO_LICENSE_FILE
Packit 90a5c9
Packit 90a5c9
endif
Packit 90a5c9