• Ben Avison's avatar
    Fixes to shared makefiles · 70323f40
    Ben Avison authored
    Detail:
      The change which permitted top-level makefiles to include only CApp,
      CModule etc accidentally broke makefiles which included HostTools (StdTools
      got included instead and overwrote the HostTools settings). Amazingly, we
      seem to have got away with this so far - but fixed now. Also, brought the
      GNUmakefiles versions in line with updates to the amu Makefiles in this
      and other respects.
    Admin:
      Tested in a RISC OS ROM build, and for building cross-compiling versions
      of the tools.
    
    Version 5.21. Tagged as 'BuildSys-5_21'
    70323f40
DbgRules 1.5 KB
# Makefile fragment for defining standard debug rules for various tools

INCLUDED_DBGRULES = YES

ifeq (GNU,${TOOLCHAIN})
CDFLAGS   += -g -O0
C++DFLAGS += -g -O0
ASDFLAGS  +=
LDDFLAGS  +=
else
CDFLAGS   += -gflv
C++DFLAGS += +g
ASDFLAGS  += -G
LDDFLAGS  += -d
endif

.SUFFIXES: .i .od .odz .s .c .h .c++ .cpp

# C source files -> object files
.c.od:
	${CC} $(filter-out ${C_NO_FNAMES},${CFLAGS}) ${CDFLAGS} -o $@ $<
	$(call make-depend,$<,$@,$(subst .od,.dd,$@))
.c.odz:
	${CC} $(filter-out ${C_NO_FNAMES},${CFLAGS}) ${CDFLAGS} ${C_MODULE} -o $@ $<
	$(call make-depend,$<,$@,$(subst .odz,.ddz,$@))
.c.i:
	${CPREPRO} ${CFLAGS} -C $< > $@

# C++ source files -> object files
.c++.od:
	${C++} $(filter-out ${C_NO_FNAMES},${C++FLAGS}) ${C++DFLAGS} -o $@ $<
	$(call make-depend,$<,$@,$(subst .od,.dd,$@))
.cpp.od:
	${C++} $(filter-out ${C_NO_FNAMES},${C++FLAGS}) ${C++DFLAGS} -o $@ $<
	$(call make-depend,$<,$@,$(subst .od,.dd,$@))
.c++.odz:
	${C++} $(filter-out ${C_NO_FNAMES},${C++FLAGS}) ${C++DFLAGS} ${C_MODULE} -o $@ $<
	$(call make-depend,$<,$@,$(subst .odz,.ddz,$@))
.cpp.odz:
	${C++} $(filter-out ${C_NO_FNAMES},${C++FLAGS}) ${C++DFLAGS} ${C_MODULE} -o $@ $<
	$(call make-depend,$<,$(subst .odz,.ddz,$@))
.c++.i:
	${CPREPRO} ${C++FLAGS} -C $< > $@
.cpp.i:
	${CPREPRO} ${C++FLAGS} -C $< > $@

# Assembler source files -> object files
.s.od:
	${AS} ${ASFLAGS} ${ASDFLAGS} -depend $(subst .od,.dd,$@) -o $@ $<
.s.odz:
	${AS} ${ASFLAGS} ${ASDFLAGS} -depend $(subst .odz,.ddz,$@) -pd "zM SETL {TRUE}" -o $@ $<
.s.i:
	@${NOP}


# EOF