######################################################################################### # GAYE Abdoulaye Walsimou, # Copyright(C) 2009 GAYE Abdoulaye Walsimou, All rights reserved. # # This program is free software; you can distribute it and/or modify it # under the terms of the GNU General Public License # (Version 2 or later) published by the Free Software Foundation. # # This program is distributed in the hope 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., # 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. ######################################################################################### # # \file Makefile # \brief Makefile of PIC18/SDCC port # \author GAYE Abdoulaye Walsimou, # \date February 2009 ######################################################################################### CC=sdcc AS=gpasm LD=gplink DEVICE=18f452 ARCH=pic16 PIC16_LIB_PATH=/usr/src/walsimou/staging_dir/share/sdcc/lib/pic16/ # Setup paths to source code SOURCE_PATH=../../Source PORT_PATH=$(SOURCE_PATH)/portable/SDCC/PIC18 DEMO_PATH=$(PWD) SDCC_CFLAGS= -m$(ARCH) -p$(DEVICE) -I. -I$(SOURCE_PATH)/include -I$(PORT_PATH) \ -I$(SOURCE_PATH) -I$(DEMO_PATH) -DSDCC_PIC18 --debug --mplab-comp --pstack-model=large GPASM_CFLAGS= -g -I$(SOURCE_PATH) -I$(PORT_PATH) LDFLAGS= -s $(DEVICE).lkr --map -I$(PIC16_LIB_PATH) LIBS= libdev$(DEVICE).lib crt0iz.o libc18f.lib libsdcc.lib libm18f.lib # # Source files # SOURCE_FILES= tasks.c list.c queue.c SOURCE_OBJ=$(SOURCE_FILES:.c=.o) PORT_FILES= port.c PORT_OBJ=$(PORT_FILES:.c=.o) VPATH=$(SOURCE_PATH):$(PORT_PATH):$(DEMO_PATH) All: $(SOURCE_OBJ) $(PORT_OBJ) $(CC) -S main.c -o main.asm $(SDCC_CFLAGS) $(AS) -c main.asm -o main.o $(GPASM_CFLAGS) $(LD) -c -o freertos.hex $^ main.o $(LIBS) $(LDFLAGS) main.o: main.c $(SOURCE_OBJ) $(PORT_OBJ): %.o: %.asm $(AS) -c $< -o $@ $(GPASM_CFLAGS) %.asm: %.c $(CC) -S $< -o $@ $(SDCC_CFLAGS) clean: rm -rf *.o *.asm *.cod *.lst *.hex *.adb *.lib *.calltree *.p *.map *.cof *.coff cleanAll: clean