diff --git a/Makefile b/Makefile index 2894247..2403cc9 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,15 @@ -.PHONY: all lib example flash clean clean-lib clean-examples +.PHONY: all lib examples flash clean clean-lib clean-examples all: flash -lib: - $(MAKE) -C src lib +flash: examples + $(MAKE) -C examples program -example: lib - $(MAKE) -C examples +examples: lib + $(MAKE) -C examples all -flash: example - $(MAKE) -C examples program +lib: + $(MAKE) -C src all clean: clean-lib clean-examples diff --git a/Makefile.conf b/Makefile.conf index b8e0946..09e8bf6 100644 --- a/Makefile.conf +++ b/Makefile.conf @@ -1,7 +1,8 @@ -HERE:=$(dir $(lastword $(MAKEFILE_LIST))) --include $(HERE)build.conf +#HERE:=$(dir $(lastword $(MAKEFILE_LIST))) +-include build.conf -TARGET_LIB ?= libdizzy +TARGET_LIB = libdizzy.a +FLASH_TARGET ?= main_testtone DEBUG ?= 0 LIBDAISY_DIR ?= ../../heck_libDaisy @@ -11,4 +12,5 @@ CXX_STANDARD ?= -std=c++17 CXXFLAGS += -Wall -Wno-unused -Wno-reorder-ctor -Wno-switch CXXFLAGS += -fdiagnostics-color=always -LDFLAGS += -u_printf_float \ No newline at end of file +#APP_TYPE ?= BOOT_NONE +#LDFLAGS += -u_printf_float \ No newline at end of file diff --git a/examples/Makefile b/examples/Makefile index a3fb84a..ed25329 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,18 +1,21 @@ HERE:=$(dir $(lastword $(MAKEFILE_LIST))) --include $(HERE)../Makefile.conf +include $(HERE)../Makefile.conf -TARGET ?= main_blink +# do not create a static lib +TARGET_LIB = DEBUG ?= 0 LIBDIZZY_DIR ?= ../src/ CXXFLAGS += -I$(LIBDIZZY_DIR) -LDFLAGS += -L$(LIBDIZZY_DIR)build/ +LDFLAGS += -L$(LIBDIZZY_DIR) LDFLAGS += -ldizzy -ALL_SRC = $(wildcard *.cc) -TARGET_SRC = $(TARGET).cc -MODULES_SRC = $(filter-out main_%,$(ALL_SRC)) -CXX_SRC = $(MODULES_SRC) $(TARGET_SRC) +SRC_EXCLUDED := \ + main_minimal.c \ + main_adc.cc \ + main_memtest1.cc \ + test_bla.c -CXX_SOURCES = $(CXX_SRC) +SOURCES := $(wildcard *) +SOURCES := $(filter-out $(SRC_EXCLUDED), $(SOURCES)) include $(LIBDAISY_DIR)/core/Makefile diff --git a/src/Makefile b/src/Makefile index d8301fe..df80385 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,7 +1,5 @@ HERE:=$(dir $(lastword $(MAKEFILE_LIST))) --include $(HERE)../Makefile.conf - -ALL_SRC = $(wildcard *.cc) -CXX_SOURCES = $(ALL_SRC) +include $(HERE)../Makefile.conf +SOURCES = $(wildcard *) include $(LIBDAISY_DIR)/core/Makefile