From d1169000cacfec6171b9e095730ec9d2cf42e295 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 8 Jan 2008 17:06:21 +0000 Subject: [PATCH] Make logic reorganized for non-GNU toolchain git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@528 42af7a65-404d-4744-a932-0658087f49c3 --- configs/README.txt | 1 + configs/c5471evm/Make.defs | 20 +++++++- configs/c5471evm/src/Makefile | 7 ++- configs/m68332evb/Make.defs | 20 +++++++- configs/m68332evb/src/Makefile | 7 ++- configs/mcu123-lpc214x/Make.defs | 20 +++++++- configs/mcu123-lpc214x/src/Makefile | 7 ++- configs/ntosd-dm320/Make.defs | 20 +++++++- configs/ntosd-dm320/src/Makefile | 7 ++- configs/pjrc-8051/Make.defs | 19 +++++++- configs/pjrc-8051/src/Makefile | 7 ++- configs/sim/Make.defs | 20 +++++++- configs/sim/src/Makefile | 7 ++- configs/z16f2800100zcog/Make.defs | 69 +++++++++++++++++----------- configs/z16f2800100zcog/src/Makefile | 14 +++--- configs/z80sim/Make.defs | 19 +++++++- configs/z80sim/src/Makefile | 7 ++- 17 files changed, 196 insertions(+), 75 deletions(-) diff --git a/configs/README.txt b/configs/README.txt index 8c10ecbce7..3bcb62e00a 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -81,6 +81,7 @@ Make.defs -- This makefile fragment provides architecture and Tools: CC, LD, AR, NM, OBJCOPY, OBJDUMP Tool options: CFLAGS, LDFLAGS + COMPILE, ASSEMBLE, ARCHIVE, and MKDEP macros When this makefile fragment runs, it will be passed TOPDIR which is the path to the root directory of the build. This makefile diff --git a/configs/c5471evm/Make.defs b/configs/c5471evm/Make.defs index 1dd6117c69..cda4d72082 100644 --- a/configs/c5471evm/Make.defs +++ b/configs/c5471evm/Make.defs @@ -59,6 +59,7 @@ OBJDUMP = $(CROSSDEV)objdump CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ OBJEXT = .o LIBEXT = .a @@ -68,11 +69,26 @@ ifeq ("${CONFIG_DEBUG}","y") LDFLAGS += -g endif +define COMPILE + @echo "CC: $1" + @$(CC) -c $(CFLAGS) $1 -o $2 +endef + +define ASSEMBLE + @echo "AS: $1" + @$(CC) -c $(AFLAGS) $1 -o $2 +endef + +define ARCHIVE + echo "AR: $2"; \ + $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } +endef + +MKDEP = $(TOPDIR)/tools/mkdeps.sh + HOSTCC = gcc HOSTINCLUDES = -I. HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = -MKDEP = $(TOPDIR)/tools/mkdeps.sh - diff --git a/configs/c5471evm/src/Makefile b/configs/c5471evm/src/Makefile index 15de1c4769..4b0541ae16 100644 --- a/configs/c5471evm/src/Makefile +++ b/configs/c5471evm/src/Makefile @@ -51,15 +51,14 @@ CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common all: libboard$(LIBEXT) $(AOBJS): %$(OBJEXT): %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libboard$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) .depend: Makefile $(SRCS) diff --git a/configs/m68332evb/Make.defs b/configs/m68332evb/Make.defs index 9bb06d3490..af4a880119 100644 --- a/configs/m68332evb/Make.defs +++ b/configs/m68332evb/Make.defs @@ -59,6 +59,7 @@ OBJDUMP = $(CROSSDEV)objdump CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ OBJEXT = .o LIBEXT = .a @@ -68,9 +69,24 @@ ifeq ("${CONFIG_DEBUG}","y") LDFLAGS += -g endif +define COMPILE + @echo "CC: $1" + @$(CC) -c $(CFLAGS) $1 -o $2 +endef + +define ASSEMBLE + @echo "AS: $1" + @$(CC) -c $(AFLAGS) $1 -o $2 +endef + +define ARCHIVE + echo "AR: $2"; \ + $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } +endef + +MKDEP = $(TOPDIR)/tools/mkdeps.sh + HOSTCC = gcc HOSTINCLUDES = -I. HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = - -MKDEP = $(TOPDIR)/tools/mkdeps.sh diff --git a/configs/m68332evb/src/Makefile b/configs/m68332evb/src/Makefile index a311e5138c..a3c568cec6 100644 --- a/configs/m68332evb/src/Makefile +++ b/configs/m68332evb/src/Makefile @@ -48,15 +48,14 @@ OBJS = $(AOBJS) $(COBJS) all: libboard$(LIBEXT) $(AOBJS): %$(OBJEXT): %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libboard$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) .depend: Makefile $(SRCS) diff --git a/configs/mcu123-lpc214x/Make.defs b/configs/mcu123-lpc214x/Make.defs index 5bf5a0d104..356b6e9c70 100644 --- a/configs/mcu123-lpc214x/Make.defs +++ b/configs/mcu123-lpc214x/Make.defs @@ -59,6 +59,7 @@ OBJDUMP = $(CROSSDEV)objdump CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ OBJEXT = .o LIBEXT = .a @@ -68,10 +69,25 @@ ifeq ("${CONFIG_DEBUG}","y") LDFLAGS += -g endif +define COMPILE + @echo "CC: $1" + @$(CC) -c $(CFLAGS) $1 -o $2 +endef + +define ASSEMBLE + @echo "AS: $1" + @$(CC) -c $(AFLAGS) $1 -o $2 +endef + +define ARCHIVE + echo "AR: $2"; \ + $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } +endef + +MKDEP = $(TOPDIR)/tools/mkdeps.sh + HOSTCC = gcc HOSTINCLUDES = -I. HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = -MKDEP = $(TOPDIR)/tools/mkdeps.sh - diff --git a/configs/mcu123-lpc214x/src/Makefile b/configs/mcu123-lpc214x/src/Makefile index 9aa2cde4da..93dea86be8 100644 --- a/configs/mcu123-lpc214x/src/Makefile +++ b/configs/mcu123-lpc214x/src/Makefile @@ -51,15 +51,14 @@ CFLAGS += -I $(TOPDIR)/arch/$(CONFIG_ARCH)/src all: libboard$(LIBEXT) $(AOBJS): %$(OBJEXT): %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libboard$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) .depend: Makefile $(SRCS) diff --git a/configs/ntosd-dm320/Make.defs b/configs/ntosd-dm320/Make.defs index 33d6dd8512..1be65e7b82 100644 --- a/configs/ntosd-dm320/Make.defs +++ b/configs/ntosd-dm320/Make.defs @@ -59,6 +59,7 @@ OBJDUMP = $(CROSSDEV)objdump CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ OBJEXT = .o LIBEXT = .a @@ -68,10 +69,25 @@ ifeq ("${CONFIG_DEBUG}","y") LDFLAGS += -g endif +define COMPILE + @echo "CC: $1" + @$(CC) -c $(CFLAGS) $1 -o $2 +endef + +define ASSEMBLE + @echo "AS: $1" + @$(CC) -c $(AFLAGS) $1 -o $2 +endef + +define ARCHIVE + echo "AR: $2"; \ + $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } +endef + +MKDEP = $(TOPDIR)/tools/mkdeps.sh + HOSTCC = gcc HOSTINCLUDES = -I. HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = -MKDEP = $(TOPDIR)/tools/mkdeps.sh - diff --git a/configs/ntosd-dm320/src/Makefile b/configs/ntosd-dm320/src/Makefile index dadf99845b..de36b3d5cb 100644 --- a/configs/ntosd-dm320/src/Makefile +++ b/configs/ntosd-dm320/src/Makefile @@ -51,15 +51,14 @@ CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common all: libboard$(LIBEXT) $(AOBJS): %$(OBJEXT): %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libboard$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) .depend: Makefile $(SRCS) diff --git a/configs/pjrc-8051/Make.defs b/configs/pjrc-8051/Make.defs index 7891d6b73d..5c2482e37e 100644 --- a/configs/pjrc-8051/Make.defs +++ b/configs/pjrc-8051/Make.defs @@ -62,11 +62,26 @@ OBJEXT = .rel LIBEXT = .lib EXEEXT = .hex +define COMPILE + @echo "CC: $1" + @$(CC) -c $(CFLAGS) $1 -o $2 +endef + +define ASSEMBLE + @echo "AS: $1" + @$(AS) $(ASFLAGS) $1 +endef + +define ARCHIVE + echo "AR: $2"; \ + $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } +endef + +MKDEP = $(TOPDIR)/tools/mkdeps.sh + HOSTCC = gcc HOSTINCLUDES = -I. HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = -MKDEP = $(TOPDIR)/tools/mkdeps.sh - diff --git a/configs/pjrc-8051/src/Makefile b/configs/pjrc-8051/src/Makefile index 17f5736e9e..31066a6372 100644 --- a/configs/pjrc-8051/src/Makefile +++ b/configs/pjrc-8051/src/Makefile @@ -50,15 +50,14 @@ CFLAGS += -I $(TOPDIR)/arch/$(CONFIG_ARCH)/src all: libboard$(LIBEXT) $(AOBJS): %$(OBJEXT): %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libboard$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) .depend: Makefile $(SRCS) diff --git a/configs/sim/Make.defs b/configs/sim/Make.defs index 972f53cbf1..528d8cf53e 100644 --- a/configs/sim/Make.defs +++ b/configs/sim/Make.defs @@ -58,6 +58,7 @@ OBJDUMP = $(CROSSDEV)objdump CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ OBJEXT = .o LIBEXT = .a @@ -67,10 +68,25 @@ ifeq ("${CONFIG_DEBUG}","y") LDFLAGS += -g endif +define COMPILE + @echo "CC: $1" + @$(CC) -c $(CFLAGS) $1 -o $2 +endef + +define ASSEMBLE + @echo "AS: $1" + @$(CC) -c $(AFLAGS) $1 -o $2 +endef + +define ARCHIVE + echo "AR: $2"; \ + $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } +endef + +MKDEP = $(TOPDIR)/tools/mkdeps.sh + HOSTCC = gcc HOSTINCLUDES = -I. HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ $(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) -pipe HOSTLDFLAGS = - -MKDEP = $(TOPDIR)/tools/mkdeps.sh diff --git a/configs/sim/src/Makefile b/configs/sim/src/Makefile index cd3e852dc9..55f6860917 100644 --- a/configs/sim/src/Makefile +++ b/configs/sim/src/Makefile @@ -48,15 +48,14 @@ OBJS = $(AOBJS) $(COBJS) all: libboard$(LIBEXT) $(AOBJS): %$(OBJEXT): %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libboard$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) .depend: Makefile $(SRCS) diff --git a/configs/z16f2800100zcog/Make.defs b/configs/z16f2800100zcog/Make.defs index d73a05a422..5cf48fa6c7 100644 --- a/configs/z16f2800100zcog/Make.defs +++ b/configs/z16f2800100zcog/Make.defs @@ -47,12 +47,12 @@ else endif ARCHASMCPUFLAGS = -cpu:Z16F2811AL -NOigcase -ARCHASMLIST = -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet +ARCHASMLIST = -NOlistmac -name -pagelen:56 -pagewidth:80 -quiet ARCHASMWARNINGS = -warn -ARCHASMDEFINES = -define:_Z16F2811AL=1 -define:_Z16K_SERIES=1 -define:_Z16F_SERIES=1 +ARCHASMDEFINES = -define:_Z16F2811AL=1 -define:_Z16K_SERIES=1 -define:_Z16F_SERIES=1 \ -define:__ASSEMBLY__ ARCHASMINCLUDES = -include:$(ZDSINCDIR)/std;$(ZDSINCDIR)/zilog -AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ - $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION) +AFLAGS = $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMLIST) \ + $(ARCHASMWARN) $(ARCHASMOPTIMIZATION) ifeq ("${CONFIG_DEBUG}","y") ARCHOPTIMIZATION = -debug -NOregvar -reduceopt @@ -61,32 +61,49 @@ else endif ARCHCPUFLAGS = -chartype:S -model:L -NOmodsect -cpu:Z16F2811AL \ - -asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) $(ARCHASMWARNINGS) $(ARCHASMOPTIMIZATION)" -ARCHLIST = -NOgenprint -keeplst -NOlist -NOlistinc -NOkeepasm + -asmsw:" $(ARCHASMCPUFLAGS) $(ARCHASMINCLUDES) (ARCHASMWARN) $(ARCHASMOPTIMIZATION)" +ARCHLIST = -NOgenprint -keeplst -NOlist -NOlistinc -NOkeepasm ARCHPICFLAGS = ARCHWARNINGS = -warn -ARCHDEFINES = -define:_Z16F2811AL -define:_Z16K_SERIES \ - -define:_Z16F_SERIES -ARCHINCLUDES = -stdinc:"$(ZDSINCDIR)/std;$(ZDSINCDIR)/zilog" \ - -usrinc:".;$(TOPDIR)/include" -CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) +ARCHDEFINES = -define:_Z16F2811AL -define:_Z16K_SERIES \ + -define:_Z16F_SERIES -define: +ARCHSTDINCLUDES = -stdinc:"$(TOPDIR)/include;$(ZDSINCDIR)/std;$(ZDSINCDIR)/zilog" +ARCHUSRINCLUDES = -userinc:"." +ARCHINCLUDES = $(ARCHSTDINCLUDES) $(ARCHUSRINCLUDES) +CCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) +ARFLAGS = -quiet -warn -CROSSDEV = -CC = $(ZDSBINDIR)/zneocc.exe -CPP = $(ZDSBINDIR)/zneoasm.exe -LD = $(ZDSBINDIR)/zneolink.exe -AS = $(ZDSBINDIR)/zneoasm.exe -AR = $(ZDSBINDIR)/czneolib.exe +CROSSDEV = +CC = $(ZDSBINDIR)/zneocc.exe +CPP = $(ZDSBINDIR)/zneoasm.exe +LD = $(ZDSBINDIR)/zneolink.exe +AS = $(ZDSBINDIR)/zneoasm.exe +AR = $(ZDSBINDIR)/zneolib.exe -ASMEXT = .asm -OBJEXT = .obj -LIBEXT = .lib -EXEEXT = .hex +ASMEXT = .asm +OBJEXT = .obj +LIBEXT = .lib +EXEEXT = .hex -HOSTCC = gcc -HOSTINCLUDES = -I. -HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe -HOSTLDFLAGS = +define COMPILE + @echo "CC: $1" + @$(CC) $(CFLAGS) $1 +endef + +define ASSEMBLE + @echo "AS: $1" + @$(AS) -c $(AFLAGS) $1 +endef + +define ARCHIVE + echo "AR: $2"; \ + $(AR) $(ARFLAGS) $1=-+$2 || { echo "$(AR) $1=-+$2 FAILED!" ; exit 1 ; } +endef MKDEP = $(TOPDIR)/tools/mknulldeps.sh + +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = diff --git a/configs/z16f2800100zcog/src/Makefile b/configs/z16f2800100zcog/src/Makefile index 0091a70b31..c910fb1e28 100644 --- a/configs/z16f2800100zcog/src/Makefile +++ b/configs/z16f2800100zcog/src/Makefile @@ -35,7 +35,10 @@ -include $(TOPDIR)/Make.defs -CFLAGS += -I$(TOPDIR)/sched +ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src +USRINCLUDES = -userinc:".;$(TOPDIR)/sched;$(ARCH_SRCDIR)/chip;$(ARCH_SRCDIR)/common" +INCLUDES = $(ARCHSTDINCLUDES) $(USRINCLUDES) +CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(INCLUDES) $(ARCHDEFINES) ASRCS = AOBJS = $(ASRCS:.S=$(OBJEXT)) @@ -45,21 +48,18 @@ COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) OBJS = $(AOBJS) $(COBJS) -ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src -CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common all: libboard$(LIBEXT) $(AOBJS): %$(OBJEXT): %.S - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libboard$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) .depend: Makefile $(SRCS) diff --git a/configs/z80sim/Make.defs b/configs/z80sim/Make.defs index 0038dce427..2e4c6db47b 100644 --- a/configs/z80sim/Make.defs +++ b/configs/z80sim/Make.defs @@ -67,9 +67,24 @@ OBJEXT = .o LIBEXT = .lib EXEEXT = .hex +define COMPILE + @echo "CC: $1" + @$(CC) -c $(CFLAGS) $1 -o $2 +endef + +define ASSEMBLE + @echo "AS: $1" + @$(AS) $(ASFLAGS) $2 $1 +endef + +define ARCHIVE + echo "AR: $2"; \ + $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } +endef + +MKDEP = $(TOPDIR)/tools/mkdeps.sh + HOSTCC = gcc HOSTINCLUDES = -I. HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe HOSTLDFLAGS = - -MKDEP = $(TOPDIR)/tools/mkdeps.sh diff --git a/configs/z80sim/src/Makefile b/configs/z80sim/src/Makefile index a1b7eab04f..fba996597c 100644 --- a/configs/z80sim/src/Makefile +++ b/configs/z80sim/src/Makefile @@ -50,15 +50,14 @@ CFLAGS += -I $(TOPDIR)/arch/$(CONFIG_ARCH)/src all: libboard$(LIBEXT) $(AOBJS): %$(OBJEXT): %$(ASMEXT) - $(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@ + $(call ASSEMBLE, $<, $@) $(COBJS) $(LINKOBJS): %$(OBJEXT): %.c - $(CC) -c $(CFLAGS) $< -o $@ + $(call COMPILE, $<, $@) libboard$(LIBEXT): $(OBJS) @( for obj in $(OBJS) ; do \ - $(AR) $@ $${obj} || \ - { echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \ + $(call ARCHIVE, $@, $${obj}); \ done ; ) .depend: Makefile $(SRCS)