sanitzie Makefiles a bit by creating a Makefile.inc
This commit is contained in:
parent
8da2abcd19
commit
d487ecfeeb
58
Makefile
58
Makefile
|
@ -1,17 +1,3 @@
|
||||||
##########################################################################
|
|
||||||
# User configuration and firmware specific object files
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
# The target, flash and ram of the LPC1xxx microprocessor.
|
|
||||||
# Use for the target the value: LPC11xx, LPC13xx or LPC17xx
|
|
||||||
TARGET = LPC13xx
|
|
||||||
FLASH = 32K
|
|
||||||
SRAM = 8K
|
|
||||||
|
|
||||||
# For USB HID support the LPC134x reserves 384 bytes from the sram,
|
|
||||||
# if you don't want to use the USB features, just use 0 here.
|
|
||||||
SRAM_USB = 384
|
|
||||||
|
|
||||||
VPATH =
|
VPATH =
|
||||||
OBJS = main.o
|
OBJS = main.o
|
||||||
|
|
||||||
|
@ -25,26 +11,17 @@ OBJS += basic/basic.o
|
||||||
OBJS += eeprom/eeprom.o
|
OBJS += eeprom/eeprom.o
|
||||||
LIBS += core/libcore.a lcd/libfont.a
|
LIBS += core/libcore.a lcd/libfont.a
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# GNU GCC compiler prefix and location
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
CROSS_COMPILE = arm-none-eabi-
|
|
||||||
AS = $(CROSS_COMPILE)gcc
|
|
||||||
CC = $(CROSS_COMPILE)gcc
|
|
||||||
LD = $(CROSS_COMPILE)gcc
|
|
||||||
SIZE = $(CROSS_COMPILE)size
|
|
||||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
|
||||||
OBJDUMP = $(CROSS_COMPILE)objdump
|
|
||||||
OUTFILE = firmware
|
|
||||||
LPCRC = tools/lpcrc
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# GNU GCC compiler flags
|
# GNU GCC compiler flags
|
||||||
##########################################################################
|
##########################################################################
|
||||||
ROOT_PATH = .
|
ROOT_PATH = .
|
||||||
INCLUDE_PATHS = -I$(ROOT_PATH) -I$(ROOT_PATH)/core
|
INCLUDE_PATHS = -I$(ROOT_PATH) -I$(ROOT_PATH)/core
|
||||||
|
|
||||||
|
include $(ROOT_PATH)/Makefile.inc
|
||||||
|
|
||||||
|
VPATH += lpc1xxx
|
||||||
|
OBJS += $(TARGET)_handlers.o LPC1xxx_startup.o
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# Startup files
|
# Startup files
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
@ -53,37 +30,16 @@ LD_PATH = lpc1xxx
|
||||||
LD_SCRIPT = $(LD_PATH)/linkscript.ld
|
LD_SCRIPT = $(LD_PATH)/linkscript.ld
|
||||||
LD_TEMP = $(LD_PATH)/memory.ld
|
LD_TEMP = $(LD_PATH)/memory.ld
|
||||||
|
|
||||||
ifeq (LPC11xx,$(TARGET))
|
|
||||||
CORTEX_TYPE=m0
|
|
||||||
else
|
|
||||||
CORTEX_TYPE=m3
|
|
||||||
endif
|
|
||||||
|
|
||||||
CPU_TYPE = cortex-$(CORTEX_TYPE)
|
|
||||||
VPATH += lpc1xxx
|
|
||||||
OBJS += $(TARGET)_handlers.o LPC1xxx_startup.o
|
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# Compiler settings, parameters and flags
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
CFLAGS = -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -fno-builtin
|
|
||||||
LDFLAGS = -nostartfiles -mthumb -mcpu=$(CPU_TYPE) -Wl,--gc-sections
|
|
||||||
LDLIBS = -lm
|
|
||||||
LDLIBS += -Lcore -lcore
|
|
||||||
LDLIBS += -Llcd -lfont
|
|
||||||
OCFLAGS = --strip-unneeded
|
|
||||||
|
|
||||||
all: firmware
|
all: firmware
|
||||||
|
|
||||||
%.o : %.c
|
%.o : %.c
|
||||||
$(CC) $(CFLAGS) -o $@ $<
|
$(CC) $(CFLAGS) -o $@ $<
|
||||||
|
|
||||||
core/libcore.a: core/projectconfig.h
|
core/libcore.a: core/projectconfig.h
|
||||||
cd core && $(MAKE)
|
cd core && $(MAKE) ROOT_PATH=../$(ROOT_PATH)
|
||||||
|
|
||||||
lcd/libfont.a lcd/render.o lcd/display.o:
|
lcd/libfont.a lcd/render.o lcd/display.o:
|
||||||
cd lcd && $(MAKE)
|
cd lcd && $(MAKE) ROOT_PATH=../$(ROOT_PATH)
|
||||||
|
|
||||||
tools/lpcrc:
|
tools/lpcrc:
|
||||||
cd tools && $(MAKE)
|
cd tools && $(MAKE)
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
##########################################################################
|
||||||
|
# User configuration and firmware specific object files
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
# The target, flash and ram of the LPC1xxx microprocessor.
|
||||||
|
# Use for the target the value: LPC11xx, LPC13xx or LPC17xx
|
||||||
|
TARGET = LPC13xx
|
||||||
|
FLASH = 32K
|
||||||
|
SRAM = 8K
|
||||||
|
|
||||||
|
# For USB HID support the LPC134x reserves 384 bytes from the sram,
|
||||||
|
# if you don't want to use the USB features, just use 0 here.
|
||||||
|
SRAM_USB = 384
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# GNU GCC compiler prefix and location
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
CROSS_COMPILE = arm-none-eabi-
|
||||||
|
AS = $(CROSS_COMPILE)gcc
|
||||||
|
CC = $(CROSS_COMPILE)gcc
|
||||||
|
LD = $(CROSS_COMPILE)gcc
|
||||||
|
SIZE = $(CROSS_COMPILE)size
|
||||||
|
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||||
|
OBJDUMP = $(CROSS_COMPILE)objdump
|
||||||
|
OUTFILE = firmware
|
||||||
|
LPCRC = tools/lpcrc
|
||||||
|
|
||||||
|
ifeq (LPC11xx,$(TARGET))
|
||||||
|
CORTEX_TYPE=m0
|
||||||
|
else
|
||||||
|
CORTEX_TYPE=m3
|
||||||
|
endif
|
||||||
|
|
||||||
|
CPU_TYPE = cortex-$(CORTEX_TYPE)
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# Compiler settings, parameters and flags
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
CFLAGS = -std=c99 -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -fno-builtin
|
||||||
|
LDFLAGS = -nostartfiles -mthumb -mcpu=$(CPU_TYPE) -Wl,--gc-sections
|
||||||
|
LDLIBS = -lm
|
||||||
|
LDLIBS += -Lcore -lcore
|
||||||
|
LDLIBS += -Llcd -lfont
|
||||||
|
OCFLAGS = --strip-unneeded
|
||||||
|
|
|
@ -34,45 +34,18 @@ OBJS += timer32/timer32.o
|
||||||
#OBJS += usbhid-rom/usbhid.o
|
#OBJS += usbhid-rom/usbhid.o
|
||||||
OBJS += wdt/wdt.o
|
OBJS += wdt/wdt.o
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# GNU GCC compiler prefix and location
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
CROSS_COMPILE = arm-none-eabi-
|
|
||||||
AS = $(CROSS_COMPILE)gcc
|
|
||||||
CC = $(CROSS_COMPILE)gcc
|
|
||||||
LD = $(CROSS_COMPILE)gcc
|
|
||||||
AR = $(CROSS_COMPILE)ar
|
|
||||||
SIZE = $(CROSS_COMPILE)size
|
|
||||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
|
||||||
OBJDUMP = $(CROSS_COMPILE)objdump
|
|
||||||
OUTFILE = firmware
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# GNU GCC compiler flags
|
# GNU GCC compiler flags
|
||||||
##########################################################################
|
##########################################################################
|
||||||
ROOT_PATH = .
|
ROOT_PATH?= ..
|
||||||
INCLUDE_PATHS = -I$(ROOT_PATH) -I..
|
INCLUDE_PATHS = -I$(ROOT_PATH) -I.
|
||||||
|
|
||||||
##########################################################################
|
include $(ROOT_PATH)/Makefile.inc
|
||||||
# Startup files
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
ifeq (LPC11xx,$(TARGET))
|
|
||||||
CORTEX_TYPE=m0
|
|
||||||
else
|
|
||||||
CORTEX_TYPE=m3
|
|
||||||
endif
|
|
||||||
|
|
||||||
CPU_TYPE = cortex-$(CORTEX_TYPE)
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# Compiler settings, parameters and flags
|
# Compiler settings, parameters and flags
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
CFLAGS = -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -fno-builtin
|
|
||||||
LDFLAGS = -nostartfiles -mthumb -mcpu=$(CPU_TYPE) -Wl,--gc-sections
|
|
||||||
|
|
||||||
all: libcore.a
|
all: libcore.a
|
||||||
|
|
||||||
libcore.a: $(OBJS)
|
libcore.a: $(OBJS)
|
||||||
|
|
39
lcd/Makefile
39
lcd/Makefile
|
@ -2,10 +2,6 @@
|
||||||
# User configuration and firmware specific object files
|
# User configuration and firmware specific object files
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
# The target, flash and ram of the LPC1xxx microprocessor.
|
|
||||||
# Use for the target the value: LPC11xx, LPC13xx or LPC17xx
|
|
||||||
TARGET = LPC13xx
|
|
||||||
|
|
||||||
OBJS =
|
OBJS =
|
||||||
OBJS += smallfonts.o
|
OBJS += smallfonts.o
|
||||||
|
|
||||||
|
@ -16,46 +12,18 @@ OBJS += display.o
|
||||||
OBJS += render.o
|
OBJS += render.o
|
||||||
OBJS += decoder.o
|
OBJS += decoder.o
|
||||||
|
|
||||||
##########################################################################
|
|
||||||
# GNU GCC compiler prefix and location
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
CROSS_COMPILE = arm-none-eabi-
|
|
||||||
AS = $(CROSS_COMPILE)gcc
|
|
||||||
CC = $(CROSS_COMPILE)gcc
|
|
||||||
LD = $(CROSS_COMPILE)gcc
|
|
||||||
AR = $(CROSS_COMPILE)ar
|
|
||||||
SIZE = $(CROSS_COMPILE)size
|
|
||||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
|
||||||
OBJDUMP = $(CROSS_COMPILE)objdump
|
|
||||||
OUTFILE = firmware
|
|
||||||
LPCRC = ./lpcrc
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# GNU GCC compiler flags
|
# GNU GCC compiler flags
|
||||||
##########################################################################
|
##########################################################################
|
||||||
ROOT_PATH = .
|
ROOT_PATH?= ..
|
||||||
INCLUDE_PATHS = -I$(ROOT_PATH) -I../core
|
INCLUDE_PATHS = -I$(ROOT_PATH) -I../core -I.
|
||||||
|
|
||||||
##########################################################################
|
include $(ROOT_PATH)/Makefile.inc
|
||||||
# Startup files
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
ifeq (LPC11xx,$(TARGET))
|
|
||||||
CORTEX_TYPE=m0
|
|
||||||
else
|
|
||||||
CORTEX_TYPE=m3
|
|
||||||
endif
|
|
||||||
|
|
||||||
CPU_TYPE = cortex-$(CORTEX_TYPE)
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# Compiler settings, parameters and flags
|
# Compiler settings, parameters and flags
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
CFLAGS = -std=c99 -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -fno-builtin
|
|
||||||
LDFLAGS = -nostartfiles -mthumb -mcpu=$(CPU_TYPE) -Wl,--gc-sections
|
|
||||||
|
|
||||||
all: libfont.a
|
all: libfont.a
|
||||||
|
|
||||||
libfont.a: $(OBJS)
|
libfont.a: $(OBJS)
|
||||||
|
@ -69,5 +37,4 @@ clean:
|
||||||
|
|
||||||
render.o: render.c render.h display.h fonts.h
|
render.o: render.c render.h display.h fonts.h
|
||||||
smallfonts.o: smallfonts.c smallfonts.h fonts.h
|
smallfonts.o: smallfonts.c smallfonts.h fonts.h
|
||||||
veramono9.o: veramono9.c veramono9.h fonts.h
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue