]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - Makefile.rules
Added locking capslock key support and default now.
[max/tmk_keyboard.git] / Makefile.rules
index 3de1c0def1135384d6af4317a60827a6d375b907..f1d0a301caf653e401749ad31db9b22b474bfcf1 100644 (file)
@@ -47,7 +47,7 @@ FORMAT = ihex
 # Object files directory
 #     To put object files in current directory, use a dot (.), do NOT make
 #     this an empty or blank macro!
-OBJDIR = obj
+OBJDIR = obj_$(TARGET)
 
 
 # Optimization level, can be [0, 1, 2, 3, s]. 
@@ -78,22 +78,6 @@ EXTRAINCDIRS = $(subst :, ,$(VPATH))
 CSTANDARD = -std=gnu99
 
 
-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)
@@ -137,7 +121,7 @@ CFLAGS += -Wstrict-prototypes
 CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
 CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
 CFLAGS += $(CSTANDARD)
-CFLAGS += -include config.h
+CFLAGS += -include $(CONFIG_H)
 
 
 #---------------- Compiler Options C++ ----------------
@@ -165,7 +149,7 @@ CPPFLAGS += -Wundef
 CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst)
 CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
 #CPPFLAGS += $(CSTANDARD)
-CPPFLAGS += -include config.h
+CPPFLAGS += -include $(CONFIG_H)
 
 
 #---------------- Assembler Options ----------------
@@ -178,7 +162,7 @@ CPPFLAGS += -include config.h
 #  -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=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100
-ASFLAGS += -include config.h
+ASFLAGS += -include $(CONFIG_H)
 
 
 #---------------- Library Options ----------------
@@ -249,42 +233,6 @@ LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
 
 
 
-#---------------- Programming Options (avrdude) ----------------
-
-# Programming hardware
-# Type: avrdude -c ?
-# to get a full listing.
-#
-AVRDUDE_PROGRAMMER = stk500v2
-
-# com1 = serial port. Use lpt1 to connect to parallel port.
-AVRDUDE_PORT = com1    # programmer connected to serial device
-
-AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
-#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
-
-
-# Uncomment the following if you want avrdude's erase cycle counter.
-# Note that this counter needs to be initialized first using -Yn,
-# see avrdude manual.
-#AVRDUDE_ERASE_COUNTER = -y
-
-# Uncomment the following if you do /not/ wish a verification to be
-# performed after programming the device.
-#AVRDUDE_NO_VERIFY = -V
-
-# Increase verbosity level.  Please use this when submitting bug
-# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> 
-# to submit bug reports.
-#AVRDUDE_VERBOSE = -v -v
-
-AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
-AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
-AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
-AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
-
-
-
 #---------------- Debugging Options ----------------
 
 # For simulavr only - target MCU frequency.
@@ -325,7 +273,6 @@ OBJDUMP = avr-objdump
 SIZE = avr-size
 AR = avr-ar rcs
 NM = avr-nm
-AVRDUDE = avrdude
 REMOVE = rm -f
 REMOVEDIR = rmdir
 COPY = cp
@@ -429,7 +376,7 @@ gccversion :
 
 # Program the device.  
 program: $(TARGET).hex $(TARGET).eep
-       $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+       $(PROGRAM_CMD)
 
 
 # Generate avr-gdb config/init file which does the following: