diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-08 17:06:21 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-08 17:06:21 +0000 |
commit | aaf14056e435090f70b7e82d42874d090d1a1e35 (patch) | |
tree | 41a2ddea543958ebb2c2d0e4018edd3275b690f2 /nuttx/configs/c5471evm | |
parent | 6be6922d92309de635a5c222d94224adab2f73e5 (diff) | |
download | px4-nuttx-aaf14056e435090f70b7e82d42874d090d1a1e35.tar.gz px4-nuttx-aaf14056e435090f70b7e82d42874d090d1a1e35.tar.bz2 px4-nuttx-aaf14056e435090f70b7e82d42874d090d1a1e35.zip |
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
Diffstat (limited to 'nuttx/configs/c5471evm')
-rw-r--r-- | nuttx/configs/c5471evm/Make.defs | 20 | ||||
-rw-r--r-- | nuttx/configs/c5471evm/src/Makefile | 7 |
2 files changed, 21 insertions, 6 deletions
diff --git a/nuttx/configs/c5471evm/Make.defs b/nuttx/configs/c5471evm/Make.defs index 1dd6117c6..cda4d7208 100644 --- a/nuttx/configs/c5471evm/Make.defs +++ b/nuttx/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/nuttx/configs/c5471evm/src/Makefile b/nuttx/configs/c5471evm/src/Makefile index 15de1c476..4b0541ae1 100644 --- a/nuttx/configs/c5471evm/src/Makefile +++ b/nuttx/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) |