Rev 227 | Blame | Last modification | View Log | RSS feed
# -*- mode: mak; -*-################################################################################ File: TOOLSET/djgpp.rul[e]# Contents: DJGPP rules## Revision History:# 06/02/00 APY Created# 25/06/00 APY - __SOURCE__# - updated gcc_depend###############################################################################################################################################################.. Remove "undef" warnings#cc_includes +=cc_defines +=cxx_includes +=cxx_defines +=as_includes +=as_defines +=################################################################################.. C Compiler definition#cc = @gcccc_init =cc_o_switch =cc_object = -o $@cc_source = $<cc_cmdfile = $(basename $@).cmdcc_flags = @$(cc_cmdfile)gcc_includes += $(usr)/includegcc_flags = -Wall -cifeq "$(DEBUG)" "1"gcc_flags += -g -O -DDEBUGelsegcc_flags += -O2endififdef ALVLgcc_flags += -DALVL=$(ALVL)endififdef DLVLgcc_flags += -DDLVL=$(DLVL)endifwc_flags += -D__SOURCE__=\"$(notdir $<)\"ifdef LEAVETMPgcc_flags += -save-tempsendifdefine cc_pre@echo [\$<] compiling..; \$(cmdfile) -ko$(cc_cmdfile) "\$(patsubst %,%\\n,$(CFLAGS)) \$(patsubst %,-D%\\n,$(cc_defines)) \$(patsubst %,%\\n,$(gcc_flags)) \$(patsubst %,-I %\\n,$(INCDIRS)) \$(patsubst %,-I %\\n,$(cc_includes)) \$(patsubst %,-I %\\n,$(gcc_includes)) \$(cc_object)"endefifndef LEAVETMPdefine cc_post@$(rm) -f $(cc_cmdfile)endefelsedefine cc_postendefendif################################################################################.. C/C++ dependencies# depend and depend.err#gcc_depend = -D__GNUC__=2 -D__STDC__gcc_depend = -Dunix -Di386 -DGO32 -DDJGPP=2 -DMSDOSifeq "$(DEBUG)" "1"gcc_depend += -DDEBUGendififdef ALVLgcc_depend += -DALVL=$(ALVL)endififdef DLVLgcc_depend += -DDLVL=$(DLVL)endifccdep = @$(SCM_BIN)/mkdependccdep_init =ccdep_o_switch = -o.${o} -f -ccdep_source = $(filter %.c %.cc %.cpp, $+) > $(subst /,\\,$@) 2> $@.errccdep_flags = -MM \$(patsubst %,%,$(CFLAGS)) \$(patsubst %,-D%,$(cc_defines)) \$(patsubst %,%,$(gcc_depend)) \$(patsubst %,-I %,$(INCDIRS)) \$(patsubst %,-I %,$(cc_includes)) \$(patsubst %,-Y %,$(gcc_includes))ccdep_pre =ccdep_post =#.. C++ Compiler definition#cxx = @gcccxx_init =cxx_o_switch =cxx_object = -o $@cxx_source = $<cxx_cmdfile = $(basename $@).cmdcxx_flags = @$(cxx_cmdfile)define cxx_pre@echo [\$<] compiling..@$(cmdfile) -ko$(cxx_cmdfile) "\$(patsubst %,%\\n,$(CXXFLAGS)) \$(patsubst %,-d%\\n,$(cxx_defines)) \$(patsubst %,%\\n,$(gcc_flags)) \$(patsubst %,-i=%\\n,$(INCDIRS)) \$(patsubst %,-i=%\\n,$(cxx_includes)) \$(patsubst %,-i=%\\n,$(gcc_includes)) \$(subst /,\\\\,$(cxx_object))"endefifndef LEAVETMPdefine cxx_post@$(rm) -f $(cxx_cmdfile)endefelsedefine cxx_postendefendif################################################################################.. Assembler definition##.. Assembler (GCC)#as = @gccas_init =as_i_switch = -I$(space)as_o_switch =as_object = -o $@as_source = $<as_cmdfile = $(basename $@).cmdas_flags = @$(as_cmdfile)gas_flags = -Wall -x assembler-with-cpp -cifeq "$(DEBUG)" "1"gas_flags += -g -DDEBUGendififdef DLVLgas_flags += -DDLVL=$(DLVL)endififdef ALVLgas_flags += -DALVL=$(ALVL)endifas_defines := $(addprefix -D,$(as_defines))as_defines += $(gas_flags)define as_pre@$(cmdfile) -ko$(as_cmdfile) "\$(patsubst %,%\\n,$(ASFLAGS)) \$(patsubst %,%\\n,$(as_defines)) \$(patsubst %,$(as_i_switch)%\\n,$(INCDIRS)) \$(patsubst %,$(as_i_switch)%\\n,$(as_includes)) \$(as_object)\\n"endefifndef LEAVETMPdefine as_post@$(rm) -f $(as_cmdfile)endefelsedefine as_postendefendif#.. Archiver#ar = arar_cmdfile = $(basename $@).arar_flags = -cvrar_o_switch = $@ @$(ar_cmdfile)define ar_pre@rm -f $@@$(cmdfile) -ko$(ar_cmdfile) \$(patsubst %,%\\n,$^)endefifndef LEAVETMPdefine ar_post@$(rm) -f $(ar_cmdfile)endefelsedefine ar_postendefendif#.. Linker#ld = gccld_init =ld_cmdfile = $(basename $@).ldifeq "$(DEBUG)" "1"ld_flags = -gendifld_o_switch = @$(ld_cmdfile)define ld_pre@export DJGPP_LIB; \DJGPP_LIB="$(subst $(space),;,$(LIBDIRS))"; \$(cmdfile) -ko$(ld_cmdfile) "$($(notdir $(basename $@))_ld)"endefifndef LEAVETMPdefine ld_post@$(rm) -f $(ld_cmdfile)endefelsedefine ld_postendefendifdefine LDDEPEND@export DJGPP_LIB; \DJGPP_LIB="$(subst $(space),;,$(LIBDIRS))"; \$(cmdfile) -ko$(BINDIR)/$(notdir $(basename $@)).dep "$($(notdir $(basename $@))_dp)"endef#