diff options
Diffstat (limited to 'nuttx/configs/ntosd-dm320')
-rw-r--r-- | nuttx/configs/ntosd-dm320/Make.defs | 20 | ||||
-rw-r--r-- | nuttx/configs/ntosd-dm320/src/Makefile | 7 |
2 files changed, 21 insertions, 6 deletions
diff --git a/nuttx/configs/ntosd-dm320/Make.defs b/nuttx/configs/ntosd-dm320/Make.defs index 33d6dd851..1be65e7b8 100644 --- a/nuttx/configs/ntosd-dm320/Make.defs +++ b/nuttx/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/nuttx/configs/ntosd-dm320/src/Makefile b/nuttx/configs/ntosd-dm320/src/Makefile index dadf99845..de36b3d5c 100644 --- a/nuttx/configs/ntosd-dm320/src/Makefile +++ b/nuttx/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) |