include config.mk MAKE += $(MAKE_J) TOOLS_PATH=$(ECOS_TOP)/upstream/gnutools/arm-eabi/bin:$(ECOS_TOP)/upstream/gnutools/i386-elf/bin .PHONY: clean all list # All installs are fully derived from configuration scripts in $(CONFIGS). CONFIGS := $(shell cd config; echo */*.sh) INSTALLS := $(patsubst %.sh,build/%/install/lib/libtarget.a,$(CONFIGS)) # Use a global ecosconfig built from src/cvs/host ECOSCONFIG=$(ECOS_TOP)/tools/tools/configtool/standalone/common/ecosconfig all: $(INSTALLS) config.mk: ./bootstrap econfig = $(ECOSCONFIG) \ --srcdir=$(ECOS_TOP)/src/$(dir $(1))/packages \ --config=$(ECOS_TOP)/build/$(1).ecc \ $(2) # Recreate build tree when .ecc changes. # Note that when you change code inside the eCos tree, you need to be # careful. It's ok to call make in the build/*/* directories when .c # files are changed, but changes to cdl and headers are not safe. build/%/install/lib/libtarget.a: build/%.ecc @echo Checking source dir: [ -d src/$(dir $*) ] rm -rf build/$* mkdir -p build/$* cd build/$* ; PATH=$(TOOLS_PATH):$$PATH $(call econfig,$*,tree) cd build/$* ; PATH=$(TOOLS_PATH):$$PATH $(call econfig,$*,check) cd build/$* ; PATH=$(TOOLS_PATH):$$PATH $(MAKE) build clean: rm -rf build build/%.ecc: config/%.sh mkdir -p build/$(dir $(*)) PATH=$(TOOLS_PATH):$$PATH HERE=config/$(dir $(*)) ECOSCONFIG="$(ECOSCONFIG) --srcdir=$(ECOS_TOP)/src/$(dir $(*))/packages --config=$@" config/$*.sh src/cvs: mkdir -p src; cd src ; cvs -d :pserver:anoncvs:@ecos.sourceware.org:/cvs/ecos login ; cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org:/cvs/ecos co -P ecos ; mv ecos cvs src/cvs/host: src/cvs mkdir -p src/cvs; cd src/cvs ; cvs -d :pserver:anoncvs:@ecos.sourceware.org:/cvs/ecos login ; cvs -z3 -d :pserver:anoncvs@ecos.sourceware.org:/cvs/ecos co -P ecos/host ; mv ecos/host . ; rm -rf ecos # To apply such a patch, cd into the top source dir, i.e. src/cvs and issue: # patch -p0 < cvs.patch patch/%.patch: cd src/$* ; cvs diff -u8p >../../patch/$*.patch ; echo -n list: @echo This is a list of targets for which we have .ecc files. @for i in $(INSTALLS); do echo $$i; done # Host eCos configuration tools (ecosconfig). Take them from CVS for now. tools: mkdir -p tools cd tools ; ../src/cvs/host/configure && make # Upstream binary tools. # This bypasses the (annoyingly interactive) eCos install script. # See http://ecos.sourceware.org/ecos/ecos-install.db for alternative locations. # See http://ecos.sourceware.org/getstart.html for standard install proc. MIRROR=ftp://ecos.sourceware.org/pub/ecos/ GNUTOOLS_DIR=gnutools/i386linux/ GNUTOOLS_ARM_EABI=ecoscentric-gnutools-arm-eabi-20081213-sw.i386linux.tar.bz2 GNUTOOLS_I386_ELF=ecoscentric-gnutools-i386-elf-20081107-sw.i386linux.tar.bz2 GNUTOOLS_TAR=$(GNUTOOLS_ARM_EABI) .PHONY: upstream upstream: \ upstream/gnutools/arm-eabi \ upstream/gnutools/i386-elf $(ECOS_TOP)/upstream/$(GNUTOOLS_ARM_EABI): mkdir -p cd $(ECOS_TOP)/upstream cd $(ECOS_TOP)/upstream; wget $(MIRROR)/$(GNUTOOLS_DIR)/$(GNUTOOLS_ARM_EABI) upstream/gnutools/arm-eabi: $(ECOS_TOP)/upstream/$(GNUTOOLS_ARM_EABI) cd $(ECOS_TOP)/upstream; tar -jxf $< $(ECOS_TOP)/upstream/$(GNUTOOLS_I386_ELF): mkdir -p cd $(ECOS_TOP)/upstream cd $(ECOS_TOP)/upstream; wget $(MIRROR)/$(GNUTOOLS_DIR)/$(GNUTOOLS_I386_ELF) upstream/gnutools/i386-elf: $(ECOS_TOP)/upstream/$(GNUTOOLS_I386_ELF) cd $(ECOS_TOP)/upstream; tar -jxf $<