2021-06-27 12:45:36 -04:00
|
|
|
VERSION := $(shell git describe) $(shell git log -1 --format=%cd --date=iso)
|
|
|
|
|
|
|
|
OUT ?= build/
|
|
|
|
CFLAGS ?= -O2 -g0
|
2022-01-12 07:37:48 -05:00
|
|
|
CFLAGS += -DVERSION="\"$(VERSION)\"" -I. -I$(OUT) -Wall -Wno-unused-variable -Wno-unused-function
|
2021-06-27 12:45:36 -04:00
|
|
|
|
|
|
|
all: $(OUT)ppkb-i2c-inputd $(OUT)ppkb-usb-flasher $(OUT)ppkb-usb-debugger $(OUT)fw-stock.bin $(OUT)ppkb-i2c-debugger $(OUT)ppkb-i2c-charger-ctl $(OUT)ppkb-i2c-flasher $(OUT)ppkb-i2c-selftest
|
|
|
|
|
|
|
|
$(OUT)ppkb-usb-flasher: usb-flasher.c common.c
|
|
|
|
@mkdir -p $(OUT)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(OUT)ppkb-usb-debugger: usb-debugger.c common.c
|
|
|
|
@mkdir -p $(OUT)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(OUT)kmap.h: keymaps/physical-map.txt keymaps/factory-keymap.txt
|
|
|
|
@mkdir -p $(OUT)
|
2022-01-15 17:53:04 -05:00
|
|
|
php keymaps/map-to-c.php $^ $@
|
2021-06-27 12:45:36 -04:00
|
|
|
|
|
|
|
$(OUT)ppkb-i2c-inputd: i2c-inputd.c $(OUT)kmap.h common.c
|
|
|
|
@mkdir -p $(OUT)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(OUT)ppkb-i2c-debugger: i2c-debugger.c common.c
|
|
|
|
@mkdir -p $(OUT)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(OUT)ppkb-i2c-charger-ctl: i2c-charger-ctl.c common.c
|
|
|
|
@mkdir -p $(OUT)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
|
|
|
|
$(OUT)ppkb-i2c-flasher: i2c-flasher.c common.c
|
|
|
|
@mkdir -p $(OUT)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
|
2022-01-17 20:07:26 -05:00
|
|
|
#$(OUT)ppkb-i2c-selftest: i2c-selftest.c common.c
|
|
|
|
# @mkdir -p $(OUT)
|
|
|
|
# $(CC) $(CFLAGS) -o $@ $<
|
2021-06-27 12:45:36 -04:00
|
|
|
|
2021-07-10 00:12:54 -04:00
|
|
|
$(OUT)fw-stock.bin $(OUT)fw-user.bin: $(wildcard firmware/*.*)
|
2021-06-27 12:45:36 -04:00
|
|
|
@mkdir -p $(OUT)
|
|
|
|
cd firmware && ./build.sh
|
|
|
|
cp -f firmware/build/fw-stock.bin $(OUT)fw-stock.bin
|
|
|
|
cp -f firmware/build/fw-user.bin $(OUT)fw-user.bin
|