sbsv2/raptor/lib/flm/win32.flm
branchwip
changeset 342 f0e42ff3359f
parent 226 59f343577f92
child 511 7581d432643a
equal deleted inserted replaced
341:4fd571a5fb6a 342:f0e42ff3359f
   148 else
   148 else
   149   CFLAGS:=$(CFLAGS) $(OPT.NOSTDINC)
   149   CFLAGS:=$(CFLAGS) $(OPT.NOSTDINC)
   150 endif
   150 endif
   151 
   151 
   152 # get the compiler to generate dependencies for us?
   152 # get the compiler to generate dependencies for us?
   153 ifeq ($(DEPEND_SKIP),)
   153 ifeq ($(NO_DEPEND_GENERATE),)
   154   CFLAGS:=$(CFLAGS) $(OPT.DEPEND)
   154   CFLAGS:=$(CFLAGS) $(OPT.DEPEND)
   155 endif
   155 endif
   156 
   156 
   157 # specifics relating to the base type of the target being processed
   157 # specifics relating to the base type of the target being processed
   158 ifeq ($(BASE_TYPE),dll)
   158 ifeq ($(BASE_TYPE),dll)
   377 
   377 
   378     $(call mapwin32file,$(1),.o): $(1) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT) | $(if $(USE_TRACE_COMPILER),$(TRACE_MARKER))
   378     $(call mapwin32file,$(1),.o): $(1) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT) | $(if $(USE_TRACE_COMPILER),$(TRACE_MARKER))
   379 	  $(call startrule,win32compile2object,,$(1)) \
   379 	  $(call startrule,win32compile2object,,$(1)) \
   380 	  $(CC) $$(if $$(filter %.C,$(1)),-lang c) $(CFLAGS) $(OPTION_CW) \
   380 	  $(CC) $$(if $$(filter %.C,$(1)),-lang c) $(CFLAGS) $(OPTION_CW) \
   381 	  $(if $(STDCPP_BUILD),$$(if $$(filter %.c %.C,$(1)),,$$(call makemacrodef,$(OPT.DEFINE),$(STDCPP_WCHAR_DEF))),) \
   381 	  $(if $(STDCPP_BUILD),$$(if $$(filter %.c %.C,$(1)),,$$(call makemacrodef,$(OPT.DEFINE),$(STDCPP_WCHAR_DEF))),) \
   382 	  $(DEFINES) $(INCLUDES) $(OPT.OUT)"$$@" "$(1)" && \
   382 	  $(DEFINES) $(INCLUDES) $(OPT.OUT)"$$@" "$(1)" \
   383 	  $(GNUSED) 's#\\\\\(.\)#/\1#g;s#/ #\\\ #g;s#\([A-Za-z]:\)\\\\#\1/#g;1,1s#.*: .* \(.\)\?$$$$#$(call mapwin32file,$(1),.o): $1 \1#' $(call mapwin32file,$(1),.dep) > $(call mapwin32file,$(1),.o.d) \
   383 	  $(if $(NO_DEPEND_GENERATE),,&& $(GNUSED) 's#\\\\\(.\)#/\1#g;s#/ #\\\ #g;s#\([A-Za-z]:\)\\\\#\1/#g;1,1s#.*: .* \(.\)\?$$$$#$(call mapwin32file,$(1),.o): $1 \1#' $(call mapwin32file,$(1),.dep) > $(call mapwin32file,$(1),.o.d)) \
   384 	  $(call endrule,win32compile2object)
   384 	  $(call endrule,win32compile2object)
   385 
   385 
   386     CLEANTARGETS:=$$(CLEANTARGETS) $(call mapwin32file,$(1),.dep)
   386     ifeq ($(NO_DEPEND_GENERATE),)
   387 
   387       CLEANTARGETS:=$$(CLEANTARGETS) $(call mapwin32file,$(1),.dep) $(DEPENDFILENAME)
   388     CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
   388     endif
   389     ifneq "$(DEPENDFILE)" ""
   389     
   390     ifeq ($(NO_DEPEND_INCLUDE),)
   390     ifneq ($(DEPENDFILE),)
   391       ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" ""
   391       ifeq ($(NO_DEPEND_INCLUDE),)
   392         -include $(DEPENDFILE)
   392         ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),)
   393       endif
   393           -include $(DEPENDFILE)
   394     endif
   394         endif
       
   395       endif
   395     endif
   396     endif
   396 
   397 
   397     # individual source file compilation
   398     # individual source file compilation
   398     SOURCETARGET_$(call sanitise,$(1)): $(call mapwin32file,$(1),.o)
   399     SOURCETARGET_$(call sanitise,$(1)): $(call mapwin32file,$(1),.o)
   399 
   400 
   417   # If Python has been used to construct the environment on Windows then the standard MW include path environment
   418   # If Python has been used to construct the environment on Windows then the standard MW include path environment
   418   # variable will have been munged to UPPERCASE.
   419   # variable will have been munged to UPPERCASE.
   419   STDMWCINCLUDEPATHS:=$(if $(MWCSym2Includes),$(MWCSym2Includes),$(MWCSYM2INCLUDES))
   420   STDMWCINCLUDEPATHS:=$(if $(MWCSym2Includes),$(MWCSym2Includes),$(MWCSYM2INCLUDES))
   420 
   421 
   421   define win32resourcecompile
   422   define win32resourcecompile
   422     # Note that two calls are made to the resource compiler here.  There seems to be no means to override the
   423     # Note that, if dependency files are required, two calls are made to the resource compiler here.
   423     # default behaviour of dumping dependency files into the CWD when using -MD.  So - we compile once for real,
   424     # There seems to be no means to override the default behaviour of dumping dependency files into the CWD when using -MD.
   424     # and then pipe dependency output through SED afterwards to create the dependency file where we want it
   425     # So - we compile once for real, and then pipe dependency output through SED afterwards to create the dependency file where we want it
   425 
   426 
   426     $(eval DEPENDFILENAME:=$(call mapwin32file,$(1),.res.d))
   427     $(eval DEPENDFILENAME:=$(call mapwin32file,$(1),.res.d))
   427     $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
   428     $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
   428 
   429 
   429     $(call mapwin32file,$(1),.res): $(1) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT)
   430     $(call mapwin32file,$(1),.res): $(1) $(PROJECT_META) $(if $(DEPENDFILE),,RESOURCE BITMAP EXPORT)
   430 	  $(call startrule,win32resourcecompile,,$(1)) \
   431 	  $(call startrule,win32resourcecompile,,$(1)) \
   431 	  MWCIncludes='$(STDMWCINCLUDEPATHS)' $(RC) $(OPT.OUT)"$$@" "$(1)" && \
   432 	  MWCIncludes='$(STDMWCINCLUDEPATHS)' $(RC) $(OPT.OUT)"$$@" "$(1)" \
   432 	  MWCIncludes='$(STDMWCINCLUDEPATHS)' $(RC) -make $(OPT.OUT)"$$@" "$(1)" | \
   433 	  $(if $(NO_DEPEND_GENERATE),,&& \
   433 	  $(GNUSED) 's#\\\\\(.\)#/\1#g;s#/ #\\\ #g;s#\([A-Za-z]:\)\\\\#\1/#g;1,1s#.*: .* \(.\)\?$$$$#$(call mapwin32file,$(1),.res): $1 \1#' > $(call mapwin32file,$(1),.res.d) \
   434 	    MWCIncludes='$(STDMWCINCLUDEPATHS)' $(RC) -make $(OPT.OUT)"$$@" "$(1)" | \
       
   435 	    $(GNUSED) 's#\\\\\(.\)#/\1#g;s#/ #\\\ #g;s#\([A-Za-z]:\)\\\\#\1/#g;1,1s#.*: .* \(.\)\?$$$$#$(call mapwin32file,$(1),.res): $1 \1#' > $(call mapwin32file,$(1),.res.d)) \
   434 	  $(call endrule,win32resourcecompile)
   436 	  $(call endrule,win32resourcecompile)
   435 
   437 
   436     CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
   438     ifeq ($(NO_DEPEND_GENERATE),)
   437     ifneq "$(DEPENDFILE)" ""
   439       CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
   438     ifeq ($(NO_DEPEND_INCLUDE),)
   440     endif
   439       ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" ""
   441     
   440         -include $(DEPENDFILE)
   442     ifneq ($(DEPENDFILE),)
   441       endif
   443       ifeq ($(NO_DEPEND_INCLUDE),)
   442     endif
   444         ifeq ($(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS))),)
       
   445           -include $(DEPENDFILE)
       
   446         endif
       
   447       endif
   443     endif
   448     endif
   444 
   449 
   445   endef
   450   endef
   446 
   451 
   447   $(foreach WIN32RESOURCEFILE,$(WIN32_RESOURCE),$(eval $(call win32resourcecompile,$(WIN32RESOURCEFILE))))
   452   $(foreach WIN32RESOURCEFILE,$(WIN32_RESOURCE),$(eval $(call win32resourcecompile,$(WIN32RESOURCEFILE))))