summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/Makefile
diff options
context:
space:
mode:
authorIngo Albrecht <prom@berlin.ccc.de>2010-03-07 01:41:32 +0100
committerHarald Welte <laforge@gnumonks.org>2010-03-07 11:47:09 +0100
commit41abd7e50055e69993d5e9c8acd9852aee51da1f (patch)
tree4f65fbe8f2f7be78262cf664be4a09933b8e19b3 /src/target/firmware/Makefile
parent60bbc89c30cb0cfd88ad46640f50e35d197a0053 (diff)
New build system.
Diffstat (limited to 'src/target/firmware/Makefile')
-rw-r--r--src/target/firmware/Makefile71
1 files changed, 16 insertions, 55 deletions
diff --git a/src/target/firmware/Makefile b/src/target/firmware/Makefile
index 0e5ff2cc..06c4df40 100644
--- a/src/target/firmware/Makefile
+++ b/src/target/firmware/Makefile
@@ -1,69 +1,30 @@
+
+# Global include path
INCLUDES=-Iinclude/ -I../../../include
--include Makefile.inc
-# individual list of object files, they should probably become libraries
+# Various objects that are currently linked into all applications
FLASH_OBJS=flash/cfi_flash.o
DISPLAY_OBJS=display/font_r8x8.o display/st7558.o
ABB_OBJS=abb/twl3025.o
RF_OBJS=rf/trf6151.o
BOARD_C123_OBJS=board/common/rffe_compal_dualband.o board/compal_e88/init.o
+
+# Board- and environment-specific startup code and linker script
START=board/common/compal_ramload_start.S
LDS=board/common/compal_ramload.lds
# The objects that we want to link with every application
-OBJS=start.o $(ABB_OBJS) $(RF_OBJS) $(DISPLAY_OBJS) $(FLASH_OBJS) $(BOARD_C123_OBJS)
-
-# The libraries that we want to link with every application
-LIBS=calypso/libcalypso.a layer1/liblayer1.a lib/libmini.a comm/libcomm.a
-
-# The list of applications we ant to build. Please add your apps here!
-APPS=hello_world l1test compal_dump compal_dsp_dump layer1
-
-APP_BINS=$(APPS:=.bin)
-APP_ELFS=$(APPS:=.elf)
-APP_OBJS=$(patsubst %,apps/%/main.o, $(APPS))
-APP_SIZES=$(APP_ELFS:.elf=.size)
-
-LST=$(OBJS:.o=.lst) $(APP_OBJS:.o=.lst) $(START:.S=.lst)
-
-all: $(APP_BINS) $(APP_ELFS) $(APP_SIZES)
+APPLICATIONS=hello_world l1test compal_dump compal_dsp_dump layer1
-start.o: $(START)
- $(CROSS_COMPILE)$(CC) $(CFLAGS) -c -o $@ $^
+# Things that go in all applications
+ANY_APP_OBJS+=$(START:.S=.o) $(ABB_OBJS) $(RF_OBJS) $(DISPLAY_OBJS) $(FLASH_OBJS) $(BOARD_C123_OBJS)
+ANY_APP_LIBS+=calypso/libcalypso.a layer1/liblayer1.a lib/libmini.a comm/libcomm.a
-%.o: %.c
- $(CROSS_COMPILE)$(CC) $(CFLAGS) -c -o $@ $^
+# Libraries are defined in subdirectories
+-include calypso/Makefile
+-include layer1/Makefile
+-include comm/Makefile
+-include lib/Makefile
-%.elf: $(OBJS) apps/%/main.o $(LIBS)
- $(CROSS_COMPILE)$(LD) $(LDFLAGS) -T $(LDS) -Bstatic -Map $@.map -o $@ --start-group $^ --end-group
- $(CROSS_COMPILE)$(SIZE) $@
-
-%.size: %.elf
- $(CROSS_COMPILE)$(SIZE) -A $^ > $@
-
-%.bin: %.elf
- $(CROSS_COMPILE)objcopy --gap-fill=0xff -O binary $^ $@
-
-# FIXME: we don't do dependencies into the subdirectories, so we always rebuild
-.PHONY: calypso/libcalypso.a
-calypso/libcalypso.a:
- make -C calypso all
-
-# FIXME: we don't do dependencies into the subdirectories, so we always rebuild
-.PHONY: layer1/liblayer1.a
-layer1/liblayer1.a:
- make -C layer1 all
-
-lib/libmini.a:
- make -C lib all
-
-# FIXME: we don't do dependencies into the subdirectories, so we always rebuild
-.PHONY: comm/libcomm.a
-comm/libcomm.a:
- make -C comm all
-clean:
- make -C calypso clean
- make -C layer1 clean
- make -C lib clean
- make -C comm clean
- rm -f *.map $(OBJS) $(APP_BINS) $(APP_ELFS) $(APP_SIZES) $(LST)
+# Include rules
+-include Makefile.inc