makefile - Can't compile simple code with SDCC for pic on debian -
i'm trying compile following code sdcc, in debian using vim , makefile:
void main(void) { } yes, simple, it's not working yet. i'm using makefile :
# gnu/linux specific make directives. # declare tools. shell = /bin/sh cc = sdcc ld = gplink echo = @echo mcu = 16f88 arch = pic14 cflags = -m$(arch) -p$(mcu) ldflags = -c -r -w -m /usr/share/sdcc/lib/$(arch)/ executable = t1 sources = test2.c objects = $(sources:.c=.o) cleanfiles = test2.o test2.asm test2.map test2.lst .suffixes: .c .o .phony: clean # compile all: $(executable) .c.o: $(at) $(cc) $(cflags) -o $*.o -c $< $(executable): $(objects) $(at) $(ld) $(ldflags) $(objects) -o $(executable) clean: $(at) rm -rf $(cleanfiles) after of output after running makefile is:
sdcc -mpic14 -p16f88 -o test2.o -c test2.c gplink -c -r -w -m /usr/share/sdcc/lib/pic14/ test2.o -o t1 make: *** [t1] segmentation fault i have tried more complex code same result, can't see what's wrong, ?
i see several things can causing problems:
when compile pics using sdcc, need option
--use-non-freebecause pic header files have special microchip licence not gpl compatible. furthermore,--use-non-freemight not available on debian because of freedom policy if installed sdcc repositories. need install latest sdcc official website.on linking stage, should include pic libraries needed run. try executing
sdcc -mpic14 -p16f88 --use-non-free -v test2.c. way, sdcc links automatically ,-v(verbose) can see calls assembler , linker , can see libraries added on linkage.
Comments
Post a Comment