From 99eeb7e0771887efc60f295db6a30a76c677c933 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 26 Jun 2013 18:18:52 -0700 Subject: [PATCH] Push final collection of CFLAGS/LDFLAGS from Makefile.config to Makefile.local This makes the final decision more explicit closer to where the flags are actually being used. This will be helpful as we add other programs, which can now easily mimic the style of flags collection as is done for fips. This also eliminates any potential confusion of FIPS_FLAGS vs. FINAL_FIPS_FLAGS, etc. The use of "FINAL_" has now been entirely eliminated. --- Makefile.local | 24 ++++++++++++------------ configure | 8 -------- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/Makefile.local b/Makefile.local index f468c64..cb73ab2 100644 --- a/Makefile.local +++ b/Makefile.local @@ -2,14 +2,14 @@ include Makefile.release -# Smash together user's values with our extra values -FINAL_FIPS_CFLAGS = -DFIPS_VERSION=$(VERSION) $(CFLAGS) $(FIPS_CFLAGS) $(extra_cflags) -FINAL_FIPS_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(FIPS_LDFLAGS) +# Smash together user's values with values from Makefile.config +FIPS_CFLAGS = -DFIPS_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(TALLOC_CFLAGS) $(LIBELF_CFLAGS) $(extra_cflags) +FIPS_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(TALLOC_LDFLAGS) $(LIBELF_LDFLAGS) -FINAL_LIBFIPS_CFLAGS = $(CFLAGS) $(LIBFIPS_CFLAGS) $(extra_cflags) -FINAL_LIBFIPS_LDFLAGS = $(LDFLAGS) $(LIBFIPS_LDFLAGS) -ldl +LIBFIPS_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(GL_CFLAGS) $(EGL_CFLAGS) $(extra_cflags) +LIBFIPS_LDFLAGS = $(LDFLAGS) -ldl -FINAL_FIPS_LINKER = CC +FIPS_LINKER = CC ALL_TARGETS = fips @@ -58,15 +58,15 @@ quiet ?= $($(shell echo $1 | sed -e s'/ .*//')) %-32.o: %.c $(global_deps) @mkdir -p .deps/$(@D) - $(call quiet,CC $(CFLAGS) -m32) -c $(FINAL_LIBFIPS_CFLAGS) -m32 $< -o $@ -MD -MP -MF .deps/$*.d + $(call quiet,CC $(CFLAGS) -m32) -c $(LIBFIPS_CFLAGS) -m32 $< -o $@ -MD -MP -MF .deps/$*.d %-64.o: %.c $(global_deps) @mkdir -p .deps/$(@D) - $(call quiet,CC $(CFLAGS) -m64) -c $(FINAL_LIBFIPS_CFLAGS) -m64 $< -o $@ -MD -MP -MF .deps/$*.d + $(call quiet,CC $(CFLAGS) -m64) -c $(LIBFIPS_CFLAGS) -m64 $< -o $@ -MD -MP -MF .deps/$*.d %.o: %.c $(global_deps) @mkdir -p .deps/$(@D) - $(call quiet,CC $(CFLAGS)) -c $(FINAL_FIPS_CFLAGS) $< -o $@ -MD -MP -MF .deps/$*.d + $(call quiet,CC $(CFLAGS)) -c $(FIPS_CFLAGS) $< -o $@ -MD -MP -MF .deps/$*.d .PHONY : clean clean: @@ -85,7 +85,7 @@ fips_srcs = \ fips_modules = $(fips_srcs:.c=.o) fips: $(fips_modules) - $(call quiet,$(FINAL_FIPS_LINKER) $(CFLAGS)) $(FINAL_FIPS_CFLAGS) $^ $(FINAL_FIPS_LDFLAGS) -o $@ + $(call quiet,$(FIPS_LINKER) $(CFLAGS)) $(FIPS_CFLAGS) $^ $(FIPS_LDFLAGS) -o $@ # GL-wrapper library, libfips LIBRARY_LINK_FLAGS = -shared -Wl,--version-script=libfips.sym @@ -112,10 +112,10 @@ libfips_32_modules = $(libfips_srcs:.c=-32.o) libfips_64_modules = $(libfips_srcs:.c=-64.o) libfips-32.so: $(libfips_32_modules) libfips.sym - $(call quiet,$(FINAL_FIPS_LINKER) $(CFLAGS) -m32) -o $@ $(FINAL_LIBFIPS_CFLAGS) -m32 $(libfips_32_modules) $(LIBRARY_LINK_FLAGS) $(FINAL_LIBFIPS_LDFLAGS) + $(call quiet,$(FIPS_LINKER) $(CFLAGS) -m32) -o $@ $(LIBFIPS_CFLAGS) -m32 $(libfips_32_modules) $(LIBRARY_LINK_FLAGS) $(LIBFIPS_LDFLAGS) libfips-64.so: $(libfips_64_modules) libfips.sym - $(call quiet,$(FINAL_FIPS_LINKER) $(CFLAGS) -m64) -o $@ $(FINAL_LIBFIPS_CFLAGS) -m64 $(libfips_64_modules) $(LIBRARY_LINK_FLAGS) $(FINAL_LIBFIPS_LDFLAGS) + $(call quiet,$(FIPS_LINKER) $(CFLAGS) -m64) -o $@ $(LIBFIPS_CFLAGS) -m64 $(libfips_64_modules) $(LIBRARY_LINK_FLAGS) $(LIBFIPS_LDFLAGS) .PHONY: install install: all diff --git a/configure b/configure index ef8aed0..ae6b31a 100755 --- a/configure +++ b/configure @@ -537,14 +537,6 @@ EGL_CFLAGS = ${egl_cflags} # Flags needed to have linker link only to necessary libraries AS_NEEDED_LDFLAGS = ${as_needed_ldflags} - -# Flags needed to compile the fips binary -FIPS_CFLAGS = \$(WARN_CFLAGS) \$(TALLOC_CFLAGS) \$(LIBELF_CFLAGS) -FIPS_LDFLAGS = \$(TALLOC_LDFLAGS) \$(LIBELF_LDFLAGS) - -# Flags needed to compile the libfips libraries -LIBFIPS_CFLAGS = \$(WARN_CFLAGS) \$(GL_CFLAGS) \$(EGL_CFLAGS) -LIBFIPS_LDFLAGS = EOF # construct config.h -- 2.43.0