-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (34 loc) · 867 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
CC=xc8
PROG=vendor_basic.hex
SRCUSB=\
src/usb/usb_descriptors.c\
src/usb/usb_device.c\
src/usb/usb_device_generic.c
SRCBSP=\
src/bsp/buttons.c\
src/bsp/leds.c
SRC=\
src/app_device_vendor_basic.c\
src/app_led_usb_status.c\
src/usb_events.c\
src/main.c\
src/system.c
OBJUSB= usb.lpp
OBJBSP= bsp.lpp
INC_DIR = -Iinc/bsp -Iinc/usb -Iinc
CHIP=18f4550
OPTIONS=--chip=$(CHIP) $(INC_DIR) --OPT=all --WARNFORMAT="warn: [%a] [%n] [%l] [%f] %s"
build: $(PROG) clean
$(PROG): usb.lpp bsp.lpp
$(CC) $(OPTIONS) $(SRC) $(OBJUSB) $(OBJBSP) -O$(PROG)
$(OBJUSB):
$(CC) $(OPTIONS) $(SRCUSB) --output=lpp -O$(OBJUSB)
$(OBJBSP):
$(CC) $(OPTIONS) $(SRCBSP) --output=lpp -O$(OBJBSP)
flash: $(PROG)
pk2cmd -M -PPIC$(CHIP) -Y -F$(PROG)
clean:
rm -f *.p1 *.d *.as *.hxl *.sym *.sdb *.pre *.cof *.cmf *.obj startup*
cleanx: clean
rm -f $(PROG) *.lpp
.PHONY: build clean flash cleanx