mirror of
https://git.sr.ht/~nabijaczleweli/tzpfms
synced 2025-04-11 09:30:02 +03:00
Common objects need to be in an archive to get correctly -flto/--as-neededed
Partial revert of e78ba80bc90fdb78f4ce47d12519280fe2e5981c
This commit is contained in:
parent
a85bcbeca2
commit
8997b47acf
9
Makefile
9
Makefile
@ -60,6 +60,10 @@ endif
|
||||
ifneq "$(findstring clang,$(shell $(CXX) --version))" ""
|
||||
# GCC doesn't have this granularity
|
||||
CXXFLAGS += -flto=full -pedantic -Wno-gnu-statement-expression -Wno-gnu-include-next -Wno-gnu-conditional-omitted-operand -Wno-c++20-designator
|
||||
ifeq "$(AR)" "ar"
|
||||
# Need this because -flto=full produces objects FSF ranlib (ar s) can't index
|
||||
override AR := llvm-ar
|
||||
endif
|
||||
else
|
||||
CXXFLAGS += -flto
|
||||
endif
|
||||
@ -134,8 +138,11 @@ $(OUTDIR)man/style.css : man/style.css
|
||||
@mkdir -p $(dir $@)
|
||||
cp $^ $@
|
||||
|
||||
$(BLDDIR)libtzpfms.a : $(subst src/,$(BLDDIR)obj/,$(subst .cpp,.o,$(COMMON_SOURCES)))
|
||||
$(AR) crs $@ $^
|
||||
|
||||
$(OUTDIR)% : $(BLDDIR)obj/bin/%.o $(subst src/,$(BLDDIR)obj/,$(subst .cpp,.o,$(COMMON_SOURCES)))
|
||||
|
||||
$(OUTDIR)% : $(BLDDIR)obj/bin/%.o $(BLDDIR)libtzpfms.a
|
||||
@mkdir -p $(dir $@)
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user