mirror of
https://xff.cz/git/pinephone-keyboard/
synced 2024-11-09 22:15:42 +01:00
6a5fe581b9
I2C register layout changed a bit to make various operations easier to implement in FW and for the user. Flashing/debugging tools now share more code. Firmware is now more configurable (it's now possible to compile-out various features). Self-testing for column-shorts is implemented. Firmware is optimized for low power consumption.
45 lines
1.4 KiB
Makefile
45 lines
1.4 KiB
Makefile
VERSION := $(shell git describe) $(shell git log -1 --format=%cd --date=iso)
|
|
|
|
OUT ?= build/
|
|
CFLAGS ?= -O2 -g0
|
|
CFLAGS += -DVERSION="\"$(VERSION)\"" -I. -I$(OUT)
|
|
|
|
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)
|
|
php keymaps/map-to-c.php $^ > $@
|
|
|
|
$(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 $@ $<
|
|
|
|
$(OUT)ppkb-i2c-selftest: i2c-selftest.c common.c
|
|
@mkdir -p $(OUT)
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
$(OUT)fw-stock.bin $(OUT)fw-user.bin: firmware/em85f684a.h firmware/main.c firmware/build.sh firmware/bootloader.bin
|
|
@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
|