
#SCRIPT = -s 12f683.lkr

OBJECTS = util.o 
FORMAT = inhx32
GPSIM=/home/tibi/Applications/bin/gpsim

all:       main.hex tester.hex

main.hex:  csimu.o $(OBJECTS) 
	gplink -s 12f683.lkr -a $(FORMAT) --map -c -o main.hex $< $(OBJECTS)
	unix2dos main.hex

tester.hex:  test.o $(OBJECTS) 
	gplink -s 12f683.lkr -a $(FORMAT) --map -c -o tester.hex $< $(OBJECTS)
	unix2dos tester.hex

#
# The module.c is only to test if we can link c program.
#
c:
	sdcc -mpic14 -p12f683 -c module.c

%.o: %.asm
	gpasm -c $<

#
# break 400
# break 500
# run
test:   tester.hex
	$(GPSIM) tester.cod
    

clean:
	rm -f *.o *.lst *.map *.hex *.cod *.cof

