mirror of https://github.com/FOME-Tech/fome-fw.git
set up precompiled header (#2971)
* ignore * set up precompiled header * makefile * fixes * cleanup * only depend cpp on pch * efifeatures in pch * f7 efifeatures * consolidate * simulator * proteus build * error handling is a good one * bootloader pch * don't auto include pch * dirs * delete on clean * bootloader cleans * clean.sh deletes pch * disable in bl for now * there was a typo so maybe it'll work now * remove todo * don't need that any more * don't need these parts * don't need this part * undo changes * use a different cpp as example * s * Revert "cleanup" This reverts commit 8de8698490f5d09c2df753f00a89751aa898be9a. * also unnecessary now * buh * comment Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
4b3345a6dd
commit
f44a84b40c
|
@ -4,3 +4,7 @@ gen_*.log
|
||||||
deliver/
|
deliver/
|
||||||
rusefi_tool.log
|
rusefi_tool.log
|
||||||
build*
|
build*
|
||||||
|
|
||||||
|
# precompiled headers
|
||||||
|
*.h.gch
|
||||||
|
*.h.gcno
|
||||||
|
|
|
@ -13,6 +13,10 @@ include rusefi_rules.mk
|
||||||
PROJECT = rusefi
|
PROJECT = rusefi
|
||||||
PROJECT_DIR = .
|
PROJECT_DIR = .
|
||||||
|
|
||||||
|
# Configure precompiled header
|
||||||
|
PCH_DIR = $(PROJECT_DIR)/pch
|
||||||
|
PCHSRC = $(PCH_DIR)/pch.h
|
||||||
|
|
||||||
# Imported source files and paths
|
# Imported source files and paths
|
||||||
CHIBIOS_CONTRIB = ChibiOS-Contrib
|
CHIBIOS_CONTRIB = ChibiOS-Contrib
|
||||||
|
|
||||||
|
@ -55,7 +59,7 @@ endif
|
||||||
|
|
||||||
# C++ specific options here (added to USE_OPT).
|
# C++ specific options here (added to USE_OPT).
|
||||||
ifeq ($(USE_CPPOPT),)
|
ifeq ($(USE_CPPOPT),)
|
||||||
USE_CPPOPT = -std=c++17 -Wno-register -fno-rtti -fno-threadsafe-statics -fno-exceptions -fno-use-cxa-atexit
|
USE_CPPOPT = -std=c++17 -Wno-register -fno-rtti -fno-threadsafe-statics -fno-exceptions -fno-use-cxa-atexit -Winvalid-pch
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Hellen is one of the boards which cares
|
# Hellen is one of the boards which cares
|
||||||
|
@ -270,7 +274,9 @@ TCPPSRC =
|
||||||
ASMXSRC = $(ALLXASMSRC) \
|
ASMXSRC = $(ALLXASMSRC) \
|
||||||
$(RUSEFIASM)
|
$(RUSEFIASM)
|
||||||
|
|
||||||
INCDIR = $(ALLINC) \
|
INCDIR = \
|
||||||
|
$(PCH_DIR) \
|
||||||
|
$(ALLINC) \
|
||||||
$(TESTINC) \
|
$(TESTINC) \
|
||||||
$(BOOTLOADERINC) \
|
$(BOOTLOADERINC) \
|
||||||
$(CHIBIOS)/os/various \
|
$(CHIBIOS)/os/various \
|
||||||
|
@ -372,3 +378,6 @@ ULIBS = -lm --specs=nano.specs
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
include $(RULESFILE)
|
include $(RULESFILE)
|
||||||
|
|
||||||
|
# Enable precompiled header
|
||||||
|
include rusefi_pch.mk
|
||||||
|
|
|
@ -39,7 +39,7 @@ endif
|
||||||
# C++ specific options here (added to USE_OPT).
|
# C++ specific options here (added to USE_OPT).
|
||||||
ifeq ($(USE_CPPOPT),)
|
ifeq ($(USE_CPPOPT),)
|
||||||
# constexpr float expf_taylor_impl probably needs just c++14 but why not go with 17?
|
# constexpr float expf_taylor_impl probably needs just c++14 but why not go with 17?
|
||||||
USE_CPPOPT = -std=c++17 -Wno-register -fno-rtti -fno-exceptions -fno-use-cxa-atexit -Werror=write-strings -Werror=type-limits
|
USE_CPPOPT = -std=c++17 -Wno-register -fno-rtti -fno-exceptions -fno-use-cxa-atexit -Werror=write-strings -Werror=type-limits -Winvalid-pch
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable this if you want the linker to remove unused code and data
|
# Enable this if you want the linker to remove unused code and data
|
||||||
|
@ -117,6 +117,10 @@ endif
|
||||||
PROJECT = bootloader
|
PROJECT = bootloader
|
||||||
PROJECT_DIR = ..
|
PROJECT_DIR = ..
|
||||||
|
|
||||||
|
# Configure precompiled header
|
||||||
|
PCH_DIR = $(PROJECT_DIR)/pch
|
||||||
|
PCHSRC = $(PCH_DIR)/pch.h
|
||||||
|
|
||||||
# Imported source files and paths
|
# Imported source files and paths
|
||||||
CHIBIOS = $(PROJECT_DIR)/ChibiOS
|
CHIBIOS = $(PROJECT_DIR)/ChibiOS
|
||||||
# todo: looks like 'CHIBIOS_CONTRIB' path is universal shall we defined it only once?
|
# todo: looks like 'CHIBIOS_CONTRIB' path is universal shall we defined it only once?
|
||||||
|
@ -209,6 +213,7 @@ TCPPSRC =
|
||||||
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
|
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
|
||||||
|
|
||||||
INCDIR = $(ALLINC) \
|
INCDIR = $(ALLINC) \
|
||||||
|
$(PCH_DIR) \
|
||||||
.. \
|
.. \
|
||||||
$(CHIBIOS)/os/various \
|
$(CHIBIOS)/os/various \
|
||||||
$(CHIBIOS)/os/ex/ST \
|
$(CHIBIOS)/os/ex/ST \
|
||||||
|
@ -317,3 +322,4 @@ ULIBS = -lm --specs=nano.specs
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
include $(RULESFILE)
|
include $(RULESFILE)
|
||||||
|
include $(PROJECT_DIR)/rusefi_pch.mk
|
||||||
|
|
|
@ -3,3 +3,4 @@
|
||||||
echo "Entering firmware/clean.sh"
|
echo "Entering firmware/clean.sh"
|
||||||
rm -rf .dep
|
rm -rf .dep
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
rm -f pch/pch.h.gch
|
||||||
|
|
|
@ -9,19 +9,15 @@
|
||||||
* @author Andrey Belomutskiy, (c) 2012-2020
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "engine.h"
|
#include "pch.h"
|
||||||
#include "allsensors.h"
|
|
||||||
#include "efi_gpio.h"
|
|
||||||
#include "pin_repository.h"
|
|
||||||
#include "trigger_central.h"
|
#include "trigger_central.h"
|
||||||
#include "fuel_math.h"
|
#include "fuel_math.h"
|
||||||
#include "engine_math.h"
|
|
||||||
#include "advance_map.h"
|
#include "advance_map.h"
|
||||||
#include "speed_density.h"
|
#include "speed_density.h"
|
||||||
#include "advance_map.h"
|
#include "advance_map.h"
|
||||||
#include "os_util.h"
|
#include "os_util.h"
|
||||||
#include "os_access.h"
|
#include "os_access.h"
|
||||||
#include "settings.h"
|
|
||||||
#include "aux_valves.h"
|
#include "aux_valves.h"
|
||||||
#include "map_averaging.h"
|
#include "map_averaging.h"
|
||||||
#include "fsio_impl.h"
|
#include "fsio_impl.h"
|
||||||
|
@ -29,7 +25,6 @@
|
||||||
#include "backup_ram.h"
|
#include "backup_ram.h"
|
||||||
#include "idle_thread.h"
|
#include "idle_thread.h"
|
||||||
#include "idle_hardware.h"
|
#include "idle_hardware.h"
|
||||||
#include "sensor.h"
|
|
||||||
#include "gppwm.h"
|
#include "gppwm.h"
|
||||||
#include "tachometer.h"
|
#include "tachometer.h"
|
||||||
#include "dynoview.h"
|
#include "dynoview.h"
|
||||||
|
@ -40,10 +35,6 @@
|
||||||
#include "mc33816.h"
|
#include "mc33816.h"
|
||||||
#endif // EFI_MC33816
|
#endif // EFI_MC33816
|
||||||
|
|
||||||
#if EFI_TUNER_STUDIO
|
|
||||||
#include "tunerstudio_outputs.h"
|
|
||||||
#endif /* EFI_TUNER_STUDIO */
|
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
#include "trigger_emulator_algo.h"
|
#include "trigger_emulator_algo.h"
|
||||||
#include "bench_test.h"
|
#include "bench_test.h"
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
/**
|
||||||
|
* @file pch.h
|
||||||
|
*
|
||||||
|
* This file is rusEFI's precompiled header. Most cpp files should include
|
||||||
|
* this file in lieu of any of the files below.
|
||||||
|
*
|
||||||
|
* This helps compilation performance by parsing/analyzing these files only
|
||||||
|
* once, then re-loading that precompiled data for every file that includes
|
||||||
|
* this file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "efifeatures.h"
|
||||||
|
#include "engine_ptr.h"
|
||||||
|
#include "global.h"
|
||||||
|
#include "efi_gpio.h"
|
||||||
|
#include "engine.h"
|
||||||
|
#include "engine_configuration.h"
|
||||||
|
#include "engine_controller.h"
|
||||||
|
#include "tunerstudio_outputs.h"
|
||||||
|
#include "engine_math.h"
|
||||||
|
#include "pwm_generator_logic.h"
|
||||||
|
#include "allsensors.h"
|
||||||
|
#include "sensor.h"
|
||||||
|
#include "error_handling.h"
|
||||||
|
#include "settings.h"
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
|
||||||
|
|
||||||
|
# Add the PCH dir to source path
|
||||||
|
SRCPATHS += $(PCH_DIR)
|
||||||
|
|
||||||
|
PCHOBJ = $(addprefix $(PCH_DIR)/, $(notdir $(PCHSRC:.h=.h.gch)))
|
||||||
|
|
||||||
|
# Compile precompiled header file(s) as a cpp file, but output to .h.gch file
|
||||||
|
$(PCHOBJ) : $(PCH_DIR)/%.h.gch : %.h Makefile
|
||||||
|
ifeq ($(USE_VERBOSE_COMPILE),yes)
|
||||||
|
@echo
|
||||||
|
$(CPPC) -c $(CPPFLAGS) $(AOPT) -I. $(IINCDIR) $< -o $@
|
||||||
|
else
|
||||||
|
@echo Compiling $(<F)
|
||||||
|
@$(CPPC) -c $(CPPFLAGS) $(AOPT) -I. $(IINCDIR) $< -o $@
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Make all cpp objects explicitly depend on the PCH
|
||||||
|
$(TCPPOBJS) : $(PCHOBJ)
|
||||||
|
$(ACPPOBJS) : $(PCHOBJ)
|
||||||
|
|
||||||
|
# Delete PCH output on clean
|
||||||
|
CLEAN_RULE_HOOK:
|
||||||
|
rm -f $(PCHOBJ)
|
|
@ -23,6 +23,10 @@ PROJECT_CPU=simulator
|
||||||
include ../firmware/rusefi.mk
|
include ../firmware/rusefi.mk
|
||||||
RULESFILE = ../firmware/rusefi_rules.mk
|
RULESFILE = ../firmware/rusefi_rules.mk
|
||||||
|
|
||||||
|
# Configure precompiled header
|
||||||
|
PCH_DIR = $(PROJECT_DIR)/pch
|
||||||
|
PCHSRC = $(PCH_DIR)/pch.h
|
||||||
|
|
||||||
# used by USE_SMART_BUILD
|
# used by USE_SMART_BUILD
|
||||||
CONFDIR = .
|
CONFDIR = .
|
||||||
|
|
||||||
|
@ -60,7 +64,7 @@ endif
|
||||||
|
|
||||||
# C++ specific options here (added to USE_OPT).
|
# C++ specific options here (added to USE_OPT).
|
||||||
ifeq ($(USE_CPPOPT),)
|
ifeq ($(USE_CPPOPT),)
|
||||||
USE_CPPOPT = -std=c++17 -Wno-register -fno-rtti
|
USE_CPPOPT = -std=c++17 -Wno-register -fno-rtti -Winvalid-pch
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable this if you want the linker to remove unused code and data.
|
# Enable this if you want the linker to remove unused code and data.
|
||||||
|
@ -193,6 +197,7 @@ CPPSRC = $(ALLCPPSRC) \
|
||||||
ASMSRC = $(PORTASM)
|
ASMSRC = $(PORTASM)
|
||||||
|
|
||||||
INCDIR = . \
|
INCDIR = . \
|
||||||
|
$(PCH_DIR) \
|
||||||
$(ALLINC) \
|
$(ALLINC) \
|
||||||
$(CHIBIOS)/os/various/cpp_wrappers \
|
$(CHIBIOS)/os/various/cpp_wrappers \
|
||||||
$(UTIL_INC) \
|
$(UTIL_INC) \
|
||||||
|
@ -290,3 +295,6 @@ endif
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
include $(RULESPATH)/rules.mk
|
include $(RULESPATH)/rules.mk
|
||||||
|
|
||||||
|
# Enable precompiled header
|
||||||
|
include $(PROJECT_DIR)/rusefi_pch.mk
|
||||||
|
|
|
@ -62,7 +62,9 @@ CPPSRC += $(ALLCPPSRC) \
|
||||||
$(PROJECT_DIR)/console/binary/tooth_logger.cpp \
|
$(PROJECT_DIR)/console/binary/tooth_logger.cpp \
|
||||||
$(PROJECT_DIR)/console/binary_log/log_field.cpp \
|
$(PROJECT_DIR)/console/binary_log/log_field.cpp \
|
||||||
|
|
||||||
INCDIR += $(UNIT_TESTS_DIR) \
|
INCDIR += \
|
||||||
|
$(PCH_DIR) \
|
||||||
|
$(UNIT_TESTS_DIR) \
|
||||||
$(ALLINC) \
|
$(ALLINC) \
|
||||||
$(UTIL_INC) \
|
$(UTIL_INC) \
|
||||||
$(PROJECT_DIR)/config/engines \
|
$(PROJECT_DIR)/config/engines \
|
||||||
|
|
|
@ -174,11 +174,13 @@ else
|
||||||
@$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
|
@$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
clean:
|
clean: CLEAN_RULE_HOOK
|
||||||
@echo Cleaning
|
@echo Cleaning
|
||||||
-rm -fR .dep $(BUILDDIR)
|
-rm -fR .dep $(BUILDDIR)
|
||||||
@echo Done
|
@echo Done
|
||||||
|
|
||||||
|
CLEAN_RULE_HOOK:
|
||||||
|
|
||||||
#
|
#
|
||||||
# Include the dependency files, should be the last of the makefile
|
# Include the dependency files, should be the last of the makefile
|
||||||
#
|
#
|
||||||
|
|
|
@ -8,6 +8,8 @@ INCDIR += $(UNIT_TESTS_DIR)/googletest/googlemock/include \
|
||||||
$(UNIT_TESTS_DIR)/googletest/googletest \
|
$(UNIT_TESTS_DIR)/googletest/googletest \
|
||||||
$(UNIT_TESTS_DIR)/googletest/googletest/include \
|
$(UNIT_TESTS_DIR)/googletest/googletest/include \
|
||||||
|
|
||||||
|
PCH_DIR = ../firmware/pch
|
||||||
|
PCHSRC = $(PCH_DIR)/pch.h
|
||||||
|
|
||||||
include $(PROJECT_DIR)/rusefi_rules.mk
|
include $(PROJECT_DIR)/rusefi_rules.mk
|
||||||
|
|
||||||
|
@ -45,7 +47,7 @@ endif
|
||||||
|
|
||||||
# C++ specific options here (added to USE_OPT).
|
# C++ specific options here (added to USE_OPT).
|
||||||
ifeq ($(USE_CPPOPT),)
|
ifeq ($(USE_CPPOPT),)
|
||||||
USE_CPPOPT = -std=gnu++17 -fno-rtti -fpermissive -fexceptions -fno-use-cxa-atexit
|
USE_CPPOPT = -std=gnu++17 -fno-rtti -fpermissive -fexceptions -fno-use-cxa-atexit -Winvalid-pch
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable this if you want the linker to remove unused code and data
|
# Enable this if you want the linker to remove unused code and data
|
||||||
|
@ -191,3 +193,4 @@ $(error Please run 'make' again. Please make sure you have 'git' command in PATH
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(UNIT_TESTS_DIR)/rules.mk
|
include $(UNIT_TESTS_DIR)/rules.mk
|
||||||
|
include $(PROJECT_DIR)/rusefi_pch.mk
|
||||||
|
|
Loading…
Reference in New Issue