While I don't entirely understand your Makefile (just my ignorance, nothing else!), but the likely problem is that SDCC can only cope with one source file at a time, unlike, say, gcc. So, you're probably going to need some kind of 'for' loop to iterate over each input file. I've been meaning to do something of the sort myself, but the number of sources in my project is just too small to be bothered, and I just specify them explicitly.
On Saturday 03 October 2009 23:19:18 Arthur Skowronek wrote: > Hello, > I tried to write a Makefile for use with sdcc 2.9.0 to > compile multifile z80 projects. > > > # apps > > CC := sdcc > > AS := as-z80 > > LD := link-z80 > > > > # segment base > > SEG_CODE := 0x8000 > > SEG_DATA := 0xd600 > > > > # flags > > CC_FLAGS := -mz80 --no-reg-params --no-std-crt0 -V --verbose > > LD_FLAGS := -b _CODE=$(SEG_CODE) -b _DATA=$(SEG_DATA) -i > > AS_FLAGS := -g > > > > ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## > > ## ## ## PRJ_MAIN := testapp.c > > > > C_SRCS := src/$(PRJ_MAIN) > > > > ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## > > ## ## ## PRJ_OUTP := $(subst .c,,$(PRJ_MAIN)) > > > > PRJ_HEAD := $(wildcard ./src/*.h) > > > > PRJ_OBJS := $(patsubst %.c,.obj/%.o,$(C_SRCS)) > > > > ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## > > ## ## ## all: $(PRJ_OUTP) > > > > .obj/%.o : %.c $(PRJ_HEAD) > > @-mkdir -p $(dir $@) > > $(CC) $(CC_FLAGS) -c $< -o $@ > > > > $(PRJ_OUTP) : $(PRJ_OBJS) > > $(LD) -- $(LD_FLAGS) $@ $(PRJ_OBJS) > > > > clean: > > -rm $(PRJ_OBJS) > > -rm $(PRJ_OUTP).bin > > but the linker complains about "invalid file type" and I don't know > why. Could someone help me please? > > Greetings > Arthur S. > > --------------------------------------------------------------------------- >--- Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Sdcc-user mailing list > Sdcc-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sdcc-user -- Richard. PGP Key-id: 0x5AB3D350 Go 'way! You're bothering me! ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user