aboutsummaryrefslogtreecommitdiffstats
path: root/fw/Makefile
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2025-08-16 14:59:36 -0230
committerSam Anthony <sam@samanthony.xyz>2025-08-16 14:59:36 -0230
commitee61ef56f775e44fd0b857a960102148910e6dce (patch)
tree9063a6a74af17d9a0ef45392dc28eaf770a22d69 /fw/Makefile
parent478a91bd82e27d8d6b2e597fd659e484ca6b205a (diff)
downloadcan-gauge-interface-ee61ef56f775e44fd0b857a960102148910e6dce.zip
usbcom: modified libusb example
Diffstat (limited to 'fw/Makefile')
-rw-r--r--fw/Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/fw/Makefile b/fw/Makefile
new file mode 100644
index 0000000..b4b0ae9
--- /dev/null
+++ b/fw/Makefile
@@ -0,0 +1,38 @@
+CC = xc8-cc
+INCLUDES = -I./ -I/home/sam/prog/mla/v2018_11_26/framework/usb/inc
+CFLAGS = -mcpu=pic16f1459 -std=c99 $(INCLUDES) -Wall
+LDFLAGS =
+
+SYSTEST_DIR = tests/system
+
+OUT = can_gauge
+SRC = $(shell find . -name "*.c" ! -name "main.c" -maxdepth 1)
+HDR = $(wildcard *.h)
+
+OBJ = $(SRC:.c=.p1)
+HEX = $(OUT).hex
+
+SYSTEST_SRC = $(wildcard $(SYSTEST_DIR)/*.c)
+SYSTEST_OBJ = $(notdir $(SYSTEST_SRC:.c=.p1))
+SYSTEST_HEX = $(SYSTEST_OBJ:.p1=.hex)
+
+$(HEX): $(OBJ) main.p1
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+%.p1: %.c
+ $(CC) $(CFLAGS) -c $<
+
+$(SYSTEST_HEX): %.hex: %.p1 $(OBJ)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+
+$(SYSTEST_OBJ): %.p1: $(SYSTEST_DIR)/%.c
+ $(CC) $(CFLAGS) -c $<
+
+clean:
+ rm -f $(OBJ) $(HEX) *.d *.p1 *.lst *.rlf *.o *.s *.sdb *.sym *.hxl *.elf *.cmf
+
+systest: $(SYSTEST_HEX)
+
+$(OBJ): $(HDR)
+
+.PHONY: clean systest