3 include Makefile.release
5 # Smash together user's values with our extra values
6 FINAL_CFLAGS = -DFIPS_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
7 FINAL_FIPS_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(TALLOC_LDFLAGS)
8 FINAL_LIBFIPS_LDFLAGS = $(LDFLAGS) -ldl
10 ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
11 FINAL_FIPS_LDFLAGS += $(CONFIGURE_LDFLAGS)
17 ifeq ($(MAKECMDGOALS),)
18 ifeq ($(shell cat .first-build-message 2>/dev/null),)
19 @FIPS_FIRST_BUILD=1 $(MAKE) --no-print-directory all
21 @echo "Compilation of fips is now complete. You can install fips with:"
25 @echo "Note that depending on the prefix to which you are installing"
26 @echo "you may need root permission (such as \"sudo make install\")."
27 @echo "See \"./configure --help\" for help on setting an alternate prefix."
28 @echo Printed > .first-build-message
34 @echo "FIXME: Should consider adding a test suite here."
36 # The user has not set any verbosity, default to quiet mode and inform the
37 # user how to enable verbose compiles.
39 quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n"
40 quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)"$1 $@\n"; $($(shell echo $1 | sed -e s'/ .*//'))
42 # The user has explicitly enabled quiet compilation.
44 quiet = @printf "$1 $@\n"; $($(shell echo $1 | sed -e s'/ .*//'))
46 # Otherwise, print the full command line.
47 quiet ?= $($(shell echo $1 | sed -e s'/ .*//'))
49 %.o: %.c $(global_deps)
51 $(call quiet,CC $(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@ -MD -MP -MF .deps/$*.d
55 rm -rf $(CLEAN); rm -rf .deps
67 fips_modules = $(fips_srcs:.c=.o)
70 $(call quiet,$(FINAL_FIPS_LINKER) $(CFLAGS)) $(FINAL_CFLAGS) $^ $(FINAL_FIPS_LDFLAGS) -o $@
72 # GL-wrapper library, libfips
73 LIBRARY_LINK_FLAGS = -shared -Wl,--version-script=libfips.sym,--no-undefined
75 extra_cflags += -I$(srcdir) -fPIC
80 libfips_modules = $(libfips_srcs:.c=.o)
82 libfips.so: $(libfips_modules) libfips.sym
83 $(call quiet,$(FINAL_FIPS_LINKER) $(CFLAGS)) $(FINAL_CFLAGS) $(libfips_modules) $(FINAL_LIBFIPS_LDFLAGS) $(LIBRARY_LINK_FLAGS) -o $@
87 mkdir -p $(DESTDIR)$(bindir)
88 install fips $(DESTDIR)$(bindir)/fips
89 mkdir -p $(DESTDIR)$(libdir)/fips
90 install -m0644 libfips.so $(DESTDIR)$(libdir)/fips/libfips.so
91 ifeq ($(MAKECMDGOALS), install)
93 @echo "Fips is now installed to $(DESTDIR)$(prefix)"
97 SRCS := $(SRCS) $(fips_srcs) $(libfips_srcs)
98 CLEAN := $(CLEAN) fips $(fips_modules) $(libfips_modules)
100 DISTCLEAN := $(DISTCLEAN) .first-build-message Makefile.config
102 DEPS := $(SRCS:%.c=.deps/%.d)
103 DEPS := $(DEPS:%.cc=.deps/%.d)