diff options
author | Alejandro Colomar <alx@kernel.org> | 2024-02-10 02:19:36 +0100 |
---|---|---|
committer | Alejandro Colomar <alx@kernel.org> | 2024-02-10 02:22:37 +0100 |
commit | 9f44a8d33150f5bceac93f6f62dab595b071ab69 (patch) | |
tree | b68ef214f4adb4e1342607611edb74021ca9c169 | |
parent | 7387fa968e35cdc8ef10a12147f6025346937325 (diff) | |
download | liba2i-9f44a8d33150f5bceac93f6f62dab595b071ab69.tar.gz |
share/mk/build/: build-obj-pch: Split to separate file
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r-- | share/mk/build/obj-pch.mk | 32 | ||||
-rw-r--r-- | share/mk/build/obj.mk | 16 |
2 files changed, 34 insertions, 14 deletions
diff --git a/share/mk/build/obj-pch.mk b/share/mk/build/obj-pch.mk new file mode 100644 index 0000000..a434cb8 --- /dev/null +++ b/share/mk/build/obj-pch.mk @@ -0,0 +1,32 @@ +# Copyright 2022-2024 Alejandro Colomar <alx@kernel.org> +# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception + + +ifndef MAKEFILE_BUILD_OBJ_PCH_INCLUDED +MAKEFILE_BUILD_OBJ_PCH_INCLUDED := 1 + + +include $(MAKEFILEDIR)/build/dev-src.mk +include $(MAKEFILEDIR)/configure/cc.mk +include $(MAKEFILEDIR)/configure/cpp.mk +include $(MAKEFILEDIR)/configure/pkgconf.mk +include $(MAKEFILEDIR)/src.mk + + +_TU_gch := $(addsuffix .gch,$(_TU_h)) + + +$(_TU_gch): %.gch: % $(MK) $(_LIB_pc_u) | %.d $$(@D)/ + $(info CC (pch) $@) + for opt in g 0 1 2 s 3 fast; do \ + $(CC) $(CPPFLAGS) $(CFLAGS) -O$$opt -c -o $*.O$$opt.gch $<; \ + done + $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< + + +.PHONY: build-obj-pch +build-obj-pch: $(_TU_gch) + @: + + +endif # include guard diff --git a/share/mk/build/obj.mk b/share/mk/build/obj.mk index 57dfb99..54e4cf1 100644 --- a/share/mk/build/obj.mk +++ b/share/mk/build/obj.mk @@ -7,28 +7,20 @@ MAKEFILE_BUILD_OBJ_INCLUDED := 1 include $(MAKEFILEDIR)/build/dev-src.mk +include $(MAKEFILEDIR)/build/obj-pch.mk include $(MAKEFILEDIR)/cmd.mk include $(MAKEFILEDIR)/configure/as.mk include $(MAKEFILEDIR)/configure/cc.mk include $(MAKEFILEDIR)/configure/cpp.mk +include $(MAKEFILEDIR)/configure/pkgconf.mk include $(MAKEFILEDIR)/src.mk -include $(MAKEFILEDIR)/verbose.mk -include $(MAKEFILEDIR)/version.mk -_TU_gch := $(addsuffix .gch,$(_TU_h)) _TU_i := $(addsuffix .i,$(_TU_c)) _TU_s := $(addsuffix .s,$(_TU_c)) _TU_o := $(addsuffix .o,$(_TU_c)) -$(_TU_gch): %.gch: % $(MK) $(_LIB_pc_u) | %.d $$(@D)/ - $(info CC (pch) $@) - for opt in g 0 1 2 s 3 fast; do \ - $(CC) $(CPPFLAGS) $(CFLAGS) -O$$opt -c -o $*.O$$opt.gch $<; \ - done - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< - $(_TU_i): %.i: % $(MK) $(_LIB_pc_u) | %.d $$(@D)/ $(info CPP $@) for opt in g 0 1 2 s 3 fast; do \ @@ -51,10 +43,6 @@ $(_TU_o): %.c.o: %.c.s %.h.gch $(MK) $(_LIB_pc_u) | %.c.d $$(@D)/ $(AS) -c -o $@ $< -.PHONY: build-obj-pch -build-obj-pch: $(_TU_gch) - @: - .PHONY: build-obj-cpp build-obj-cpp: $(_TU_i) @: |