diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 000000000..7be152450 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,17 @@ +build: + image: teaci/msys32 + pull: true + shell: mingw32 + commands: + - echo -e "[librepilot-mingw]\nSigLevel = Optional TrustAll\nServer = http://download.librepilot.org/repo/mingw" >> /etc/pacman.conf + - pacman -Syu --noconfirm --noprogressbar --needed git unzip tar mingw-w64-i686-toolchain mingw-w64-i686-ccache mingw-w64-i686-qt5 mingw-w64-i686-SDL mingw-w64-i686-mesa mingw-w64-i686-openssl mingw-w64-i686-gdal-minimal mingw-w64-i686-OpenSceneGraph mingw-w64-i686-osgearth + - mingw32-make all_sdk_install + - git config core.filemode false + - mingw32-make build-info && cat build/build-info.txt + - mingw32-make opfw_resource + - mingw32-make gcs + - mingw32-make package + +clone: + depth: 1000 + tags: true diff --git a/Makefile b/Makefile index 21490caee..35ae7624a 100644 --- a/Makefile +++ b/Makefile @@ -106,15 +106,6 @@ $(foreach var, $(SANITIZE_GCC_VARS), $(eval $(call SANITIZE_VAR,$(var),disallowe SANITIZE_DEPRECATED_VARS := USE_BOOTLOADER CLEAN_BUILD $(foreach var, $(SANITIZE_DEPRECATED_VARS), $(eval $(call SANITIZE_VAR,$(var),deprecated))) -# Make sure this isn't being run as root unless installing (no whoami on Windows, but that is ok here) -ifeq ($(shell whoami 2>/dev/null),root) - ifeq ($(filter install uninstall,$(MAKECMDGOALS)),) - ifndef FAKEROOTKEY - $(error You should not be running this as root) - endif - endif -endif - # Decide on a verbosity level based on the V= parameter export AT := @ ifndef V diff --git a/flight/make/common-defs.mk b/flight/make/common-defs.mk index db5e7a6c7..76b26e961 100644 --- a/flight/make/common-defs.mk +++ b/flight/make/common-defs.mk @@ -234,43 +234,43 @@ endif # Generate code for PyMite # $(OUTDIR)/pmlib_img.c $(OUTDIR)/pmlib_nat.c $(OUTDIR)/pmlibusr_img.c $(OUTDIR)/pmlibusr_nat.c $(OUTDIR)/pmfeatures.h: $(wildcard $(PYMITELIB)/*.py) $(wildcard $(PYMITEPLAT)/*.py) $(wildcard $(FLIGHTPLANLIB)/*.py) $(wildcard $(FLIGHTPLANS)/*.py) -# @echo $(MSG_PYMITEINIT) $(call toprel, $@) +# @echo $(MSG_PYMITEINIT) $(call toprel,$@) # @$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -s --memspace=flash -o $(OUTDIR)/pmlib_img.c --native-file=$(OUTDIR)/pmlib_nat.c $(PYMITELIB)/list.py $(PYMITELIB)/dict.py $(PYMITELIB)/__bi.py $(PYMITELIB)/sys.py $(PYMITELIB)/string.py $(wildcard $(FLIGHTPLANLIB)/*.py) # @$(PYTHON) $(PYMITETOOLS)/pmGenPmFeatures.py $(PYMITEPLAT)/pmfeatures.py > $(OUTDIR)/pmfeatures.h # @$(PYTHON) $(PYMITETOOLS)/pmImgCreator.py -f $(PYMITEPLAT)/pmfeatures.py -c -u -o $(OUTDIR)/pmlibusr_img.c --native-file=$(OUTDIR)/pmlibusr_nat.c $(FLIGHTPLANS)/test.py # Link: create ELF output file from object files. ifeq ($(USE_CXX), YES) -$(eval $(call LINK_CXX_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ), $(ALLLIB))) +$(eval $(call LINK_CXX_TEMPLATE,$(OUTDIR)/$(TARGET).elf,$(ALLOBJ),$(ALLLIB))) else -$(eval $(call LINK_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ), $(ALLLIB))) +$(eval $(call LINK_TEMPLATE,$(OUTDIR)/$(TARGET).elf,$(ALLOBJ),$(ALLLIB))) endif # Assemble: create object files from assembler source files. -$(foreach src, $(ASRC), $(eval $(call ASSEMBLE_TEMPLATE, $(src)))) +$(foreach src, $(ASRC), $(eval $(call ASSEMBLE_TEMPLATE,$(src)))) # Assemble: create object files from assembler source files. ARM-only -$(foreach src, $(ASRCARM), $(eval $(call ASSEMBLE_ARM_TEMPLATE, $(src)))) +$(foreach src, $(ASRCARM), $(eval $(call ASSEMBLE_ARM_TEMPLATE,$(src)))) # Compile: create object files from C source files. -$(foreach src, $(SRC), $(eval $(call COMPILE_C_TEMPLATE, $(src)))) +$(foreach src, $(SRC), $(eval $(call COMPILE_C_TEMPLATE,$(src)))) # Compile: create object files from C source files. ARM-only -$(foreach src, $(SRCARM), $(eval $(call COMPILE_C_ARM_TEMPLATE, $(src)))) +$(foreach src, $(SRCARM), $(eval $(call COMPILE_C_ARM_TEMPLATE,$(src)))) ifeq ($(USE_CXX), YES) # Compile: create object files from C++ source files. -$(foreach src, $(CPPSRC), $(eval $(call COMPILE_CXX_TEMPLATE, $(src)))) +$(foreach src, $(CPPSRC), $(eval $(call COMPILE_CXX_TEMPLATE,$(src)))) # Compile: create object files from C++ source files. ARM-only -$(foreach src, $(CPPSRCARM), $(eval $(call COMPILE_CXX_ARM_TEMPLATE, $(src)))) +$(foreach src, $(CPPSRCARM), $(eval $(call COMPILE_CXX_ARM_TEMPLATE,$(src)))) endif # Compile: create assembler files from C source files. ARM/Thumb -$(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC)) +$(eval $(call PARTIAL_COMPILE_TEMPLATE,SRC)) # Compile: create assembler files from C source files. ARM only -$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM)) +$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE,SRCARM)) # Add opfw target $(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION))) @@ -287,7 +287,7 @@ bino: $(OUTDIR)/$(TARGET).bin.o opfw: $(OUTDIR)/$(TARGET).opfw # Display sizes of sections. -$(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf)) +$(eval $(call SIZE_TEMPLATE,$(OUTDIR)/$(TARGET).elf)) # Target: clean project clean: diff --git a/flight/make/firmware-defs.mk b/flight/make/firmware-defs.mk index 48f65bb3c..14873835e 100644 --- a/flight/make/firmware-defs.mk +++ b/flight/make/firmware-defs.mk @@ -227,9 +227,14 @@ endef define LINK_TEMPLATE .SECONDARY : $(1) .PRECIOUS : $(2) $(3) -$(1): $(2) $(3) +$(1).input_files: $(2) $(3) + $(V1) rm -rf $(1).input_files + $(foreach file,$(2) $(3), + $(V1) echo $(file) >> $$@) + +$(1): $(1).input_files @echo $(MSG_LINKING) $$(call toprel, $$@) - $(V1) $(CC) $(THUMB) $$(CFLAGS) $$(CPPFLAGS) $(2) $(3) --output $$@ $$(LDFLAGS) + $(V1) $(CC) $(THUMB) $$(CFLAGS) $$(CPPFLAGS) @$(1).input_files --output $$@ $$(LDFLAGS) endef # Link: create ELF output file from object files. @@ -238,9 +243,14 @@ endef define LINK_CXX_TEMPLATE .SECONDARY : $(1) .PRECIOUS : $(2) $(3) -$(1): $(2) $(3) +$(1).input_files: $(2) $(3) + $(V1) rm -rf $(1).input_files + $(foreach file,$(2) $(3), + $(V1) echo $(file) >> $$@) + +$(1): $(1).input_files @echo $(MSG_LINKING) $$(call toprel, $$@) - $(V1) $(CXX) $(THUMB) $$(CFLAGS) $$(CPPFLAGS) $$(CXXFLAGS) $(2) $(3) --output $$@ $$(LDFLAGS) + $(V1) $(CXX) $(THUMB) $$(CFLAGS) $$(CPPFLAGS) $$(CXXFLAGS) @$(1).input_files --output $$@ $$(LDFLAGS) endef # Compile: create assembler files from C source files. ARM/Thumb diff --git a/flight/pios/inc/pios_posix.h b/flight/pios/inc/pios_posix.h index aaf3cdc95..466082cfe 100644 --- a/flight/pios/inc/pios_posix.h +++ b/flight/pios/inc/pios_posix.h @@ -29,14 +29,16 @@ #include #ifndef __cplusplus + typedef enum { FALSE = 0, TRUE = !FALSE } bool; -#endif #ifndef false #define false FALSE #define true TRUE #endif +#endif + // #define FILEINFO FILE* // #define PIOS_SERVO_NUM_OUTPUTS 8 diff --git a/flight/targets/boards/simposix/firmware/Makefile b/flight/targets/boards/simposix/firmware/Makefile index 00d4f3f58..7aa0f3511 100644 --- a/flight/targets/boards/simposix/firmware/Makefile +++ b/flight/targets/boards/simposix/firmware/Makefile @@ -324,31 +324,31 @@ endif # Link: create ELF output file from object files. -$(eval $(call LINK_CXX_TEMPLATE, $(OUTDIR)/$(TARGET).elf, $(ALLOBJ))) +$(eval $(call LINK_CXX_TEMPLATE,$(OUTDIR)/$(TARGET).elf,$(ALLOBJ))) # Assemble: create object files from assembler source files. -$(foreach src, $(ASRC), $(eval $(call ASSEMBLE_TEMPLATE, $(src)))) +$(foreach src, $(ASRC), $(eval $(call ASSEMBLE_TEMPLATE,$(src)))) # Assemble: create object files from assembler source files. ARM-only -$(foreach src, $(ASRCARM), $(eval $(call ASSEMBLE_ARM_TEMPLATE, $(src)))) +$(foreach src, $(ASRCARM), $(eval $(call ASSEMBLE_ARM_TEMPLATE,$(src)))) # Compile: create object files from C source files. -$(foreach src, $(SRC), $(eval $(call COMPILE_C_TEMPLATE, $(src)))) +$(foreach src, $(SRC), $(eval $(call COMPILE_C_TEMPLATE,$(src)))) # Compile: create object files from C source files. ARM-only -$(foreach src, $(SRCARM), $(eval $(call COMPILE_C_ARM_TEMPLATE, $(src)))) +$(foreach src, $(SRCARM), $(eval $(call COMPILE_C_ARM_TEMPLATE,$(src)))) # Compile: create object files from C++ source files. -$(foreach src, $(CPPSRC), $(eval $(call COMPILE_CXX_TEMPLATE, $(src)))) +$(foreach src, $(CPPSRC), $(eval $(call COMPILE_CXX_TEMPLATE,$(src)))) # Compile: create object files from C++ source files. ARM-only -$(foreach src, $(CPPSRCARM), $(eval $(call COMPILE_CPP_ARM_TEMPLATE, $(src)))) +$(foreach src, $(CPPSRCARM), $(eval $(call COMPILE_CPP_ARM_TEMPLATE,$(src)))) # Compile: create assembler files from C source files. ARM/Thumb -$(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC)) +$(eval $(call PARTIAL_COMPILE_TEMPLATE,SRC)) # Compile: create assembler files from C source files. ARM only -$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM)) +$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE,SRCARM)) $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin diff --git a/tool_install.sh b/tool_install.sh index ae8aeca9f..670b35730 100755 --- a/tool_install.sh +++ b/tool_install.sh @@ -76,7 +76,7 @@ function download_file #2 The output directory function zip_extract { - unzip "$1" -d "$2" + unzip -q "$1" -d "$2" } ## Extracts a 7zip file