mirror of
https://github.com/osiweb/unified_retro_keyboard.git
synced 2024-09-07 08:54:58 +00:00
- asdf_modifier.c: refactor CAPS LOCK setting and add LED setting - asdf_arch_atmega328p.[ch]: add in LED definitions and functions - add dummy asdf_arch_caps_led() function to arch files so test can compile.
159 lines
3.7 KiB
Makefile
159 lines
3.7 KiB
Makefile
# -*- makefile -*-
|
|
|
|
ARCH = test
|
|
KEYMAP = test
|
|
|
|
ARCH_TOKEN = _Arch_$(ARCH)
|
|
|
|
TEST_DIR = ../test
|
|
UNITY_DIR = $(TEST_DIR)/unity
|
|
BUILD_DIR = ../build
|
|
UNITY_SCRIPTS = $(UNITY_DIR)/auto
|
|
ARCH_DIR = ./Arch
|
|
KEYMAPS_DIR = ./Keymaps
|
|
|
|
CC = gcc
|
|
VERSION =
|
|
RELEASE=
|
|
|
|
CLEAN_FILES =
|
|
CLEANALL_FILES =
|
|
|
|
CFLAGS=-std=c99
|
|
CFLAGS += -Wall
|
|
CFLAGS += -Wextra
|
|
CFLAGS += -Wpointer-arith
|
|
CFLAGS += -Wcast-align
|
|
CFLAGS += -Wwrite-strings
|
|
CFLAGS += -Wswitch-default
|
|
CFLAGS += -Wunreachable-code
|
|
CFLAGS += -Winit-self
|
|
CFLAGS += -Wmissing-field-initializers
|
|
CFLAGS += -Wno-unknown-pragmas
|
|
CFLAGS += -Wstrict-prototypes
|
|
CFLAGS += -Wundef
|
|
CFLAGS += -Wold-style-definition
|
|
|
|
SRC_FILES = main.c asdf.c asdf_actions.c asdf_modifiers.c asdf_repeat.c asdf_keymaps.c asdf_buffer.c asdf_arch.c
|
|
OBJ_FILES = $(SRC_FILES:.c=.o)
|
|
|
|
|
|
ARCH_FILES = asdf_arch.c asdf_arch.h
|
|
CLEAN_FILES += ARCH_FILES
|
|
|
|
TESTS = repeat modifiers keymaps interface keyscan
|
|
|
|
TEST1 = asdf_repeat
|
|
TEST1_SRC = $(TEST_DIR)/test_$(TEST1).c
|
|
TEST1_DEPS = ./$(TEST1).c $(UNITY_DIR)/unity.c
|
|
TEST1_BUILD = $(BUILD_DIR)/test_$(TEST1)
|
|
|
|
TEST2 = asdf_modifiers
|
|
TEST2_SRC = $(TEST_DIR)/test_$(TEST2).c ./asdf_arch.c
|
|
TEST2_DEPS = ./$(TEST2).c $(UNITY_DIR)/unity.c
|
|
TEST2_BUILD = $(BUILD_DIR)/test_$(TEST2)
|
|
|
|
TEST3 = asdf_keymaps
|
|
TEST3_SRC = $(TEST_DIR)/test_$(TEST3).c
|
|
TEST3_DEPS = ./$(TEST3).c $(UNITY_DIR)/unity.c
|
|
TEST3_BUILD = $(BUILD_DIR)/test_$(TEST3)
|
|
|
|
TEST4 = asdf_buffer
|
|
TEST4_SRC = $(TEST_DIR)/test_$(TEST4).c
|
|
TEST4_DEPS = ./$(TEST4).c $(UNITY_DIR)/unity.c
|
|
TEST4_BUILD = $(BUILD_DIR)/test_$(TEST4)
|
|
|
|
TEST5 = asdf
|
|
TEST5_SRC = $(TEST_DIR)/test_$(TEST5).c
|
|
TEST5_DEPS = ./$(TEST5).c $(UNITY_DIR)/unity.c ./asdf_actions.c ./asdf_arch.c ./$(TEST1).c $(TEST2).c $(TEST3).c $(TEST4).c
|
|
TEST5_BUILD = $(BUILD_DIR)/test_$(TEST5)
|
|
|
|
.SUFFIXES:
|
|
.SUFFIXES: .c .o .bin .hex
|
|
|
|
%.o: %.c
|
|
$(TARGET_CC) -c $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $<
|
|
|
|
all: test
|
|
|
|
asdf_keymap_defs.h: $(KEYMAPS_DIR)/asdf_all_keymap_defs_$(KEYMAP).h $(KEYMAPDEFS_H_TOKEN)
|
|
cp $< $@
|
|
GENERATED_FILES += asdf_keymap_defs.h
|
|
|
|
|
|
asdf_arch.c: $(ARCH_DIR)/asdf_arch_$(ARCH).c _Arch_$(ARCH)
|
|
cp $< $@
|
|
GENERATED_FILES += asdf_arch.c
|
|
|
|
|
|
asdf_arch.h: $(ARCH_DIR)/asdf_arch_$(ARCH).h _Arch_$(ARCH)
|
|
cp $< $@
|
|
GENERATED_FILES += asdf_arch.h
|
|
|
|
$(ARCH_TOKEN):
|
|
touch $(ARCH_TOKEN)
|
|
|
|
asdf_keymaps.c: asdf.h asdf_ascii.h asdf_modifiers.h asdf_arch.h asdf_keymaps.h asdf_keymap_defs.h
|
|
asdf_modifiers.c: asdf_modifiers.h asdf_arch.h asdf_keymap_defs.h
|
|
asdf_arch.h: asdf_arch.h
|
|
|
|
tags: $(SRC_FILES)
|
|
etags $(SRC_FILES)
|
|
|
|
.PHONY: test
|
|
test: test1 test2 test3 test4 test5
|
|
|
|
.PHONY: test1
|
|
test1: $(TEST1_BUILD)
|
|
$(TEST1_BUILD)
|
|
|
|
.PHONY: test2
|
|
test2: $(TEST2_BUILD)
|
|
$(TEST2_BUILD)
|
|
|
|
.PHONY: test3
|
|
test3: $(TEST3_BUILD)
|
|
$(TEST3_BUILD)
|
|
|
|
.PHONY: test4
|
|
test4: $(TEST4_BUILD)
|
|
$(TEST4_BUILD)
|
|
|
|
.PHONY: test5
|
|
test5: $(TEST5_BUILD)
|
|
$(TEST5_BUILD)
|
|
|
|
|
|
$(TEST1_BUILD): $(TEST1_SRC) $(TEST1_DEPS)
|
|
$(CC) -o $@ -I. -I$(TEST_DIR) -I$(UNITY_DIR) $(CFLAGS) $(TEST1_SRC) $(TEST1_DEPS)
|
|
|
|
$(TEST2_BUILD): $(TEST2_SRC) $(TEST2_DEPS)
|
|
$(CC) -o $@ -I. -I$(TEST_DIR) -I$(UNITY_DIR) $(CFLAGS) $(TEST2_SRC) $(TEST2_DEPS)
|
|
|
|
$(TEST3_BUILD): $(TEST3_SRC) $(TEST3_DEPS)
|
|
$(CC) -o $@ -I. -I$(TEST_DIR) -I$(UNITY_DIR) $(CFLAGS) $(TEST3_SRC) $(TEST3_DEPS)
|
|
|
|
$(TEST4_BUILD): $(TEST4_SRC) $(TEST4_DEPS)
|
|
$(CC) -o $@ -I. -I$(TEST_DIR) -I$(UNITY_DIR) $(CFLAGS) $(TEST4_SRC) $(TEST4_DEPS)
|
|
|
|
$(TEST5_BUILD): $(TEST5_SRC) $(TEST5_DEPS)
|
|
$(CC) -o $@ -I. -I$(TEST_DIR) -I$(UNITY_DIR) $(CFLAGS) $(TEST5_SRC) $(TEST5_DEPS)
|
|
|
|
TEST_BUILD_FILES += $(TEST1_BUILD) $(TEST2_BUILD) $(TEST3_BUILD) $(TEST4_BUILD) $(TEST5_BUILD)
|
|
|
|
CLEAN_FILES += $(TEST_BUILD_FILES) _Arch_* *.o
|
|
CLEAN_FILES += ~* *\#
|
|
|
|
CLEANALL_FILES += $(GENERATED_FILES) $(TARGET_BUILD_FILES) $(TEST_BUILD_FILES)
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f $(CLEAN_FILES)
|
|
|
|
.PHONY: cleanall
|
|
cleanall:
|
|
rm -f $(CLEAN_FILES) $(CLEANALL_FILES)
|
|
|
|
|
|
include Makefile.deps
|