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.
-# 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
%-32.o: %.c $(global_deps)
@mkdir -p .deps/$(@D)
%-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)
%-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)
%.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
fips_modules = $(fips_srcs:.c=.o)
fips: $(fips_modules)
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
# GL-wrapper library, libfips
LIBRARY_LINK_FLAGS = -shared -Wl,--version-script=libfips.sym
libfips_64_modules = $(libfips_srcs:.c=-64.o)
libfips-32.so: $(libfips_32_modules) libfips.sym
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
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
.PHONY: install
install: all
# Flags needed to have linker link only to necessary libraries
AS_NEEDED_LDFLAGS = ${as_needed_ldflags}
# 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 =