Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,34 @@ all: $(BUILD)/ec.rom

# Include common source
COMMON_DIR=src/common
INCLUDE += $(COMMON_DIR)/common.mk
INCLUDE += $(COMMON_DIR)/Makefile.mk
CFLAGS=-I$(COMMON_DIR)/include -D__FIRMWARE_VERSION__=$(VERSION)
include $(COMMON_DIR)/common.mk
include $(COMMON_DIR)/Makefile.mk
SRC += $(foreach src, $(common-y), $(COMMON_DIR)/$(src))

# Include the board's source
BOARD_DIR=src/board/$(BOARD)
INCLUDE += $(BOARD_DIR)/board.mk
INCLUDE += $(BOARD_DIR)/Makefile.mk
CFLAGS+=-I$(BOARD_DIR)/include -D__BOARD__=$(BOARD)
include $(BOARD_DIR)/board.mk
include $(BOARD_DIR)/Makefile.mk
SRC += $(foreach src, $(board-y), $(BOARD_DIR)/$(src))
SRC += $(foreach src, $(board-common-y), $(SYSTEM76_COMMON_DIR)/$(src))
SRC += $(foreach src, $(keyboard-y), $(KEYBOARD_DIR)/$(src))

# The board will define the embedded controller
# Include the embedded controller's source
EC_DIR=src/ec/$(EC)
INCLUDE += $(EC_DIR)/ec.mk
INCLUDE += $(EC_DIR)/Makefile.mk
CFLAGS+=-I$(EC_DIR)/include
include $(EC_DIR)/ec.mk
include $(EC_DIR)/Makefile.mk
SRC += $(foreach src, $(ec-y), $(EC_DIR)/$(src))

# The EC will define the architecture
# Include the architecture's source
ARCH_DIR=src/arch/$(ARCH)
INCLUDE += $(ARCH_DIR)/arch.mk
INCLUDE += $(ARCH_DIR)/Makefile.mk
CFLAGS+=-I$(ARCH_DIR)/include -D__ARCH__=$(ARCH)
include $(ARCH_DIR)/arch.mk
include $(ARCH_DIR)/Makefile.mk
SRC += $(foreach src, $(arch-y), $(ARCH_DIR)/$(src))

include $(ARCH_DIR)/toolchain.mk
Expand Down Expand Up @@ -87,10 +87,13 @@ fmt:
lint:
./scripts/lint/lint.sh

# TODO: Move "common" out of board directory
.PHONY: list-boards
list-boards:
@cd src/board && for board in */*/board.mk; do \
echo "$$(dirname "$$board")"; \
@cd src/board && for board in */*/Makefile.mk; do \
if [ "$$board" != "system76/common/Makefile.mk" ]; then \
echo "$$(dirname "$$board")"; \
fi; \
done

# This target is run during setup, and is not shown in the help text.
Expand Down
4 changes: 2 additions & 2 deletions docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ For details on configuring the Mega 2560 and breakout board, see
#### Setup

1. Enable parallel port debugging in the EC firmware
- Uncomment `PARALLEL_DEBUG` in `src/board/system76/common/common.mk`
- Uncomment `PARALLEL_DEBUG` in `src/board/system76/common/Makefile.mk`
- Build and flash the firmware for the target
2. Power off target
3. Remove bottom panel
Expand Down Expand Up @@ -112,7 +112,7 @@ Requirements:
- USB-C cable

1. Enable I2C debugging in the EC firmware for the target
- Uncomment `I2C_DEBUGGER` in `src/board/system76/common/common.mk`
- Uncomment `I2C_DEBUGGER` in `src/board/system76/common/Makefile.mk`
- Build and flash firmware
2. Connect Trinket M0 to host
- This will create an ACM device at `/dev/ttyACM*`
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ endif

# Include system76 common source
SYSTEM76_COMMON_DIR=src/board/system76/common
INCLUDE += $(SYSTEM76_COMMON_DIR)/common.mk
INCLUDE += $(SYSTEM76_COMMON_DIR)/Makefile.mk
CFLAGS+=-I$(SYSTEM76_COMMON_DIR)/include

# Fan configs
Expand Down Expand Up @@ -129,7 +129,7 @@ ifndef KEYBOARD
$(error KEYBOARD is not set by the board)
endif
KEYBOARD_DIR=src/keyboard/system76/$(KEYBOARD)
include $(KEYBOARD_DIR)/keyboard.mk
include $(KEYBOARD_DIR)/Makefile.mk

# Add kbled
ifeq ($(CONFIG_HAVE_KBLED),y)
Expand All @@ -152,10 +152,10 @@ endif # CONFIG_HAVE_KBLED
CFLAGS += -DPS2_TOUCHPAD=$(CONFIG_PS2_TOUCHPAD)

# Add scratch ROM
include $(SYSTEM76_COMMON_DIR)/scratch/scratch.mk
include $(SYSTEM76_COMMON_DIR)/scratch/Makefile.mk

# Add scratch ROM for flash access
include $(SYSTEM76_COMMON_DIR)/flash/flash.mk
include $(SYSTEM76_COMMON_DIR)/flash/Makefile.mk
board-common-y += flash/wrapper.c

# Set external programmer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FLASH_CFLAGS=$(CFLAGS)
# Include flash source.
FLASH_DIR=$(SYSTEM76_COMMON_DIR)/flash
# Note: main.c *must* be first to ensure that flash_start is at the correct address
FLASH_INCLUDE += $(FLASH_DIR)/flash.mk
FLASH_INCLUDE += $(FLASH_DIR)/Makefile.mk
FLASH_CFLAGS+=-I$(FLASH_DIR)/include -D__FLASH__
FLASH_SRC += $(foreach src, $(flash-y), $(FLASH_DIR)/$(src))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ SCRATCH_CFLAGS=$(CFLAGS)

# Include scratch source
SCRATCH_DIR=$(SYSTEM76_COMMON_DIR)/scratch
SCRATCH_INCLUDE += $(SCRATCH_DIR)/scratch.mk
SCRATCH_INCLUDE += $(SCRATCH_DIR)/Makefile.mk
SCRATCH_CFLAGS+=-I$(SCRATCH_DIR)/include -D__SCRATCH__
SCRATCH_SRC += $(foreach src, $(scratch-y), $(SCRATCH_DIR)/$(src))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ CONFIG_FAN1_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ CONFIG_FAN2_POINTS = " \
"

# Add system76 common code
include src/board/system76/common/common.mk
include src/board/system76/common/Makefile.mk
File renamed without changes.
File renamed without changes.
Loading