X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Makefile.common;h=795e7b999bf9d3ff050b91d9e709d0d9f84327b9;hb=3e56e80c7d938c2b03bafb0606978b715c2ee0ee;hp=8037b07721b07ab6275263c5ec59bafc065e6da2;hpb=54b5bafaacf0d7863b7bdb84dd69cbc80db77956;p=qmk_firmware.git diff --git a/Makefile.common b/Makefile.common index 8037b0772..795e7b999 100644 --- a/Makefile.common +++ b/Makefile.common @@ -50,15 +50,40 @@ # List C source files here. (C dependencies are automatically generated.) SRC = tmk.c \ + layer.c \ key_process.c \ - usb.c \ usb_keyboard.c \ - usb_mouse.c \ usb_debug.c \ + usb.c \ jump_bootloader.c \ - print.c + print.c \ + timer.c \ + util.c SRC += $(TARGET_SRC) +# Option modules +ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE) + SRC += usb_mouse.c +endif +ifdef MOUSEKEY_ENABLE + SRC += mousekey.c +endif +ifdef PS2_MOUSE_ENABLE + SRC += ps2.c \ + ps2_mouse.c +endif +ifdef USB_EXTRA_ENABLE + SRC += usb_extra.c +endif + +ALL_SRC = $(SRC) +ALL_SRC += usb_mouse.c \ + mousekey.c \ + ps2.c \ + ps2_mouse.c \ + usb_extra.c + + # C source file search path VPATH = $(TARGET_DIR):$(COMMON_DIR) @@ -115,18 +140,38 @@ EXTRAINCDIRS = $(TARGET_DIR) $(COMMON_DIR) CSTANDARD = -std=gnu99 +OPT_DEFS = +ifdef MOUSEKEY_ENABLE + OPT_DEFS += -DMOUSEKEY_ENABLE +endif +ifdef PS2_MOUSE_ENABLE + OPT_DEFS += -DPS2_MOUSE_ENABLE +endif +ifdef USB_EXTRA_ENABLE + OPT_DEFS += -DUSB_EXTRA_ENABLE +endif +ifdef USB_NKRO_ENABLE + OPT_DEFS += -DUSB_NKRO_ENABLE +endif +ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE) + OPT_DEFS += -DUSB_MOUSE_ENABLE +endif + # Place -D or -U options here for C sources CDEFS = -DF_CPU=$(F_CPU)UL +CDEFS += $(OPT_DEFS) # Place -D or -U options here for ASM sources ADEFS = -DF_CPU=$(F_CPU) +ADEFS += $(OPT_DEFS) # Place -D or -U options here for C++ sources CPPDEFS = -DF_CPU=$(F_CPU)UL #CPPDEFS += -D__STDC_LIMIT_MACROS #CPPDEFS += -D__STDC_CONSTANT_MACROS +CPPDEFS += $(OPT_DEFS) @@ -155,6 +200,7 @@ CFLAGS += -Wstrict-prototypes CFLAGS += -Wa,-adhlns=$(@:%.o=$(OBJDIR)/%.lst) CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) CFLAGS += $(CSTANDARD) +CFLAGS += -include config.h #---------------- Compiler Options C++ ---------------- @@ -182,6 +228,7 @@ CPPFLAGS += -Wundef CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst) CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) #CPPFLAGS += $(CSTANDARD) +CPPFLAGS += -include config.h #---------------- Assembler Options ---------------- @@ -194,6 +241,7 @@ CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS)) # -listing-cont-lines: Sets the maximum number of continuation lines of hex # dump that will be displayed for a given single line of source input. ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100 +ASFLAGS += -include config.h #---------------- Library Options ---------------- @@ -390,6 +438,11 @@ ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) # Default target. all: begin gccversion sizebefore build sizeafter end +depend: tmk.c + @echo $< + @echo $(