makefile moved to root folder

This commit is contained in:
tkl 2016-07-29 08:37:13 +02:00
parent 9f845eb691
commit ff8edf8c51
14 changed files with 73 additions and 74 deletions

View File

@ -197,7 +197,39 @@
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="distclean" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="all" path="software/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="debug all" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="debug clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments> BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="debug deploy" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments> BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>deploy</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="distclean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>distclean</buildTarget>
@ -205,31 +237,7 @@
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="debug all" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="debug clean" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments> BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="debug deploy" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments> BOARD=stm32f4-discovery DEBUG=y</buildArguments>
<buildTarget>deploy</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="release all" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="release all" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments>BOARD=stm32f4-discovery</buildArguments>
<buildTarget>all</buildTarget>
@ -237,15 +245,7 @@
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="release deploy" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments> BOARD=stm32f4-discovery</buildArguments>
<buildTarget>deploy</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="release clean" path="source" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="release clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments> BOARD=stm32f4-discovery</buildArguments>
<buildTarget>clean</buildTarget>
@ -253,12 +253,12 @@
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="all" path="software/test/firmware/kernel/list" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<target name="release deploy" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget>
<buildArguments> BOARD=stm32f4-discovery</buildArguments>
<buildTarget>deploy</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="msp430-ccrf example_radio_rx all" path="software/source/test" targetID="org.eclipse.cdt.build.MakeTargetBuilder">

View File

@ -22,7 +22,6 @@ stages:
build_job:
script:
- "cd source"
- "make all BOARD=stm32f4-discovery"
stage: build
except:
@ -30,19 +29,16 @@ build_job:
check_job:
script:
- "cd source"
- "make check BOARD=stm32f4-discovery"
stage: check
#deploy_job:
# script:
# - "cd source"
# - "make deploy BOARD=stm32f4-discovery"
# stage: deploy
#test_job:
# script:
# - "cd source"
# - "make install APP=test BOARD=stm32f4-discovery"
# stage: test

View File

@ -2,7 +2,7 @@
#
##############################################################
include ../config/make/rules.mk
include config/make/rules.mk
OS_NAME = kosmos
@ -15,16 +15,16 @@ CHECK_FOLDER :=
SOURCES := $(wildcard $(SRC_DIR)/*.c)
ASM_SOURCES := $(wildcard $(SRC_DIR)/*.s)
OBJECTS = $(SOURCES:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
ASM_OBJECTS = $(ASMSOURCES:$(SRC_DIR)/%.s=$(OBJ_DIR)/%.o)
DEPS = $(SOURCES:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.d)
OBJECTS = $(SOURCES:$(ROOT_DIR)/%.c=$(OBJ_DIR)/%.o)
ASM_OBJECTS = $(ASMSOURCES:$(ROOT_DIR)/%.s=$(OBJ_DIR)/%.o)
DEPS = $(SOURCES:$(ROOT_DIR)/%.c=$(OBJ_DIR)/%.d)
#include subfolders
include firmware/firmware.mk
include source/firmware/firmware.mk
SOURCES += $(foreach folder, $(SUB_FOLDER), $(wildcard $(SRC_DIR)/$(folder)/*.c))
CHECKSOURCES += $(foreach folder, $(CHECK_FOLDER), $(wildcard $(SRC_DIR)/$(folder)/*.c))
ASMSOURCES += $(foreach folder, $(SUB_FOLDER), $(wildcard $(SRC_DIR)/$(folder)/*.s))
SOURCES += $(foreach folder, $(SUB_FOLDER), $(wildcard $(ROOT_DIR)/$(folder)/*.c))
CHECKSOURCES += $(foreach folder, $(CHECK_FOLDER), $(wildcard $(ROOT_DIR)/$(folder)/*.c))
ASMSOURCES += $(foreach folder, $(SUB_FOLDER), $(wildcard $(ROOT_DIR)/$(folder)/*.s))
all: check $(MAINFILE)
@ -35,6 +35,8 @@ deploy: all
cp $(SRC_DIR)/firmware/kernel/interface/*.* $(EXE_DIR)/include/
check:
echo $(CHECK_FOLDER)
echo $(CHECKSOURCES)
$(CPPCHECK) $(CPPCHECK_FLAGS) $(CHECKSOURCES)
@ -42,14 +44,14 @@ $(MAINFILE): $(OBJECTS) $(ASM_OBJECTS)
@$(MKDIR) $(EXE_DIR)
$(AR) rcs $(MAINFILE) $(OBJECTS) $(ASM_OBJECTS)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
$(OBJ_DIR)/%.o: $(ROOT_DIR)/%.c
@rm -rf $(LIB)
@$(MKDIR) $(OBJ_DIR)
@$(foreach folder, $(SUB_FOLDER), $(shell mkdir -p $(OBJ_DIR)/$(folder)))
$(call makedep,$<,$@,$(subst .o,.d,$@))
$(CC) $(CFLAGS) -c $< -o $@
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.s
$(OBJ_DIR)/%.o: $(ROOT_DIR)/%.s
@$(MKDIR) $(OBJ_DIR)
@$(foreach folder, $(SUB_FOLDER), $(shell mkdir -p $(OBJ_DIR)/$(folder)))
$(CC) $(CFLAGS) -c $< -o $@
@ -58,6 +60,7 @@ clean:
$(foreach folder, $(SUB_FOLDER), $(shell rm -f $(OBJ_DIR)/$(folder)/*.o))
$(foreach folder, $(SUB_FOLDER), $(shell rm -f $(OBJ_DIR)/$(folder)/*.d))
-rm -f $(OBJ_DIR)/*.o \
$(EXE_DIR)/include/* \
$(OBJ_DIR)/*.d \
$(MAINFILE)

View File

@ -1,3 +1,3 @@
ifeq ($(CPU), stm32f4xx)
include firmware/arch/stm32f4xx/stm32f4xx.mk
include source/firmware/arch/stm32f4xx/stm32f4xx.mk
endif

View File

@ -1,6 +1,6 @@
INCLUDES += firmware/arch/stm32f4xx/board
DOC_SRC += firmware/arch/stm32f4xx/board
INCLUDES += source/firmware/arch/stm32f4xx/board
DOC_SRC += source/firmware/arch/stm32f4xx/board
ifeq ($(BOARD), stm32f4-discovery)
include firmware/arch/stm32f4xx/board/stm32f4-discovery/stm32f4-discovery.mk
include source/firmware/arch/stm32f4xx/board/stm32f4-discovery/stm32f4-discovery.mk
endif

View File

@ -1,4 +1,4 @@
CHECK_FOLDER += firmware/arch/stm32f4xx/board/stm32f4-discovery
SUB_FOLDER += firmware/arch/stm32f4xx/board/stm32f4-discovery
INCLUDES += firmware/arch/stm32f4xx/board/stm32f4-discovery/include
DOC_SRC += firmware/arch/stm32f4xx/board/stm32f4-discovery
CHECK_FOLDER += source/firmware/arch/stm32f4xx/board/stm32f4-discovery
SUB_FOLDER += source/firmware/arch/stm32f4xx/board/stm32f4-discovery
INCLUDES += source/firmware/arch/stm32f4xx/board/stm32f4-discovery/include
DOC_SRC += source/firmware/arch/stm32f4xx/board/stm32f4-discovery

View File

@ -1,3 +1,3 @@
INCLUDES += firmware/arch/stm32f4xx/cpu
DOC_SRC += firmware/arch/stm32f4xx/cpu
INCLUDES += source/firmware/arch/stm32f4xx/cpu
DOC_SRC += source/firmware/arch/stm32f4xx/cpu

View File

@ -1,5 +1,5 @@
CHECK_FOLDER += firmware/arch/stm32f4xx/driver
SUB_FOLDER += firmware/arch/stm32f4xx/driver
INCLUDES += firmware/arch/stm32f4xx/driver/include
DOC_SRC += firmware/arch/stm32f4xx/driver
DOC_SRC += firmware/arch/stm32f4xx/driver/include
CHECK_FOLDER += source/firmware/arch/stm32f4xx/driver
SUB_FOLDER += source/firmware/arch/stm32f4xx/driver
INCLUDES += source/firmware/arch/stm32f4xx/driver/include
DOC_SRC += source/firmware/arch/stm32f4xx/driver
DOC_SRC += source/firmware/arch/stm32f4xx/driver/include

View File

@ -1 +1 @@
include firmware/arch/stm32f4xx/lib/stdperiph/stdperiph.mk
include source/firmware/arch/stm32f4xx/lib/stdperiph/stdperiph.mk

View File

@ -1,4 +1,4 @@
SUB_FOLDER += firmware/arch/stm32f4xx/lib/stdperiph/src
INCLUDES += firmware/arch/stm32f4xx/lib/stdperiph/inc
INCLUDES += firmware/arch/stm32f4xx/lib/stdperiph/CMSIS/ST/STM32F4xx/Include
INCLUDES += firmware/arch/stm32f4xx/lib/stdperiph/CMSIS/Include
SUB_FOLDER += source/firmware/arch/stm32f4xx/lib/stdperiph/src
INCLUDES += source/firmware/arch/stm32f4xx/lib/stdperiph/inc
INCLUDES += source/firmware/arch/stm32f4xx/lib/stdperiph/CMSIS/ST/STM32F4xx/Include
INCLUDES += source/firmware/arch/stm32f4xx/lib/stdperiph/CMSIS/Include

View File

@ -1,9 +1,9 @@
CHECK_FOLDER += firmware/arch/stm32f4xx
SUB_FOLDER += firmware/arch/stm32f4xx
INCLUDES += firmware/arch/stm32f4xx/include
DOC_SRC += firmware/arch/stm32f4xx
CHECK_FOLDER += source/firmware/arch/stm32f4xx
SUB_FOLDER += source/firmware/arch/stm32f4xx
INCLUDES += source/firmware/arch/stm32f4xx/include
DOC_SRC += source/firmware/arch/stm32f4xx
include firmware/arch/stm32f4xx/board/board.mk
include firmware/arch/stm32f4xx/cpu/cpu.mk
include firmware/arch/stm32f4xx/driver/driver.mk
include firmware/arch/stm32f4xx/lib/lib.mk
include source/firmware/arch/stm32f4xx/board/board.mk
include source/firmware/arch/stm32f4xx/cpu/cpu.mk
include source/firmware/arch/stm32f4xx/driver/driver.mk
include source/firmware/arch/stm32f4xx/lib/lib.mk

View File

@ -1,2 +1,2 @@
include firmware/arch/arch.mk
include firmware/kernel/kernel.mk
include source/firmware/arch/arch.mk
include source/firmware/kernel/kernel.mk

View File

@ -1,4 +1,4 @@
CHECK_FOLDER += firmware/kernel/driver
SUB_FOLDER += firmware/kernel/driver
INCLUDES += firmware/kernel/driver/include
DOC_SRC += firmware/kernel/driver
CHECK_FOLDER += source/firmware/kernel/driver
SUB_FOLDER += source/firmware/kernel/driver
INCLUDES += source/firmware/kernel/driver/include
DOC_SRC += source/firmware/kernel/driver

View File

@ -1,7 +1,7 @@
CHECK_FOLDER += firmware/kernel
SUB_FOLDER += firmware/kernel
INCLUDES += firmware/kernel/include
INCLUDES += firmware/kernel/interface
DOC_SRC += firmware/kernel
CHECK_FOLDER += source/firmware/kernel
SUB_FOLDER += source/firmware/kernel
INCLUDES += source/firmware/kernel/include
INCLUDES += source/firmware/kernel/interface
DOC_SRC += source/firmware/kernel
include firmware/kernel/driver/driver.mk
include source/firmware/kernel/driver/driver.mk