# Makefile # # Copyright (C) 2006,2007 Nuno Sucena Almeida # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #sources = $(wildcard *.asm) sources=interupt.asm delay.asm uart.asm eeprom.asm menu.asm sources+=i2c.asm i2c_eeprom.asm i2c_expander.asm setup.asm main.asm includes = $(wildcard *.inc) objects = $(patsubst %.asm,%.o,$(sources)) name = thematrix sources1 = bootloader.asm objects1 = $(patsubst %.asm,%.o,$(sources1)) name1 = bootloader # processor #PROC=16f628 #PROC=16f648a PROC=16f88 # assembler AS=gpasm ASFLAGS=-p $(PROC) -e ON INCFLAGS= # linker LINK=gplink LINKFLAGS=-m -c -s /usr/share/gputils/lkr/$(PROC).lkr # Simulator SIM=gpsim allobjects=$(objects) $(objects1) all: $(objects) $(name) ## $(name1) $(allobjects): %.o: %.asm @echo compiling $< $(AS) $(ASFLAGS) $(INCFLAGS) -c $< -o $@ $(name): $(sources) $(includes) @echo creating $(name) $(LINK) $(LINKFLAGS) -o $(name) $(objects) $(name1): $(objects1) $(sources1) @echo creating $(name1) $(LINK) $(LINKFLAGS) -o $(name1) $(objects1) $(name1)-prog: $(objects1) $(name1) @echo programming... clean: rm -f *~ *.o *.lst *.cod *.hex *.cof *.map a.out gmon.out $(name) sim: all $(SIM) -pp${PROC} -s $(name).cod