diff options
Diffstat (limited to 'nuttx/configs/z80sim')
-rw-r--r-- | nuttx/configs/z80sim/Make.defs | 19 | ||||
-rw-r--r-- | nuttx/configs/z80sim/src/Makefile | 7 |
2 files changed, 20 insertions, 6 deletions
diff --git a/nuttx/configs/z80sim/Make.defs b/nuttx/configs/z80sim/Make.defs index 0038dce42..2e4c6db47 100644 --- a/nuttx/configs/z80sim/Make.defs +++ b/nuttx/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/nuttx/configs/z80sim/src/Makefile b/nuttx/configs/z80sim/src/Makefile index a1b7eab04..fba996597 100644 --- a/nuttx/configs/z80sim/src/Makefile +++ b/nuttx/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) |