3 include Makefile.release
5 # Smash together user's values with values from Makefile.config
6 FIPS_CFLAGS = -DFIPS_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(TALLOC_CFLAGS) $(LIBELF_CFLAGS) $(extra_cflags)
7 FIPS_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(TALLOC_LDFLAGS) $(LIBELF_LDFLAGS)
9 LIBFIPS_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(GL_CFLAGS) $(EGL_CFLAGS) $(extra_cflags)
10 LIBFIPS_LDFLAGS = $(LDFLAGS) -ldl
16 ifeq ($(COMPILER_SUPPORTS_32),Yes)
17 ALL_TARGETS += libfips-32.so
20 ifeq ($(COMPILER_SUPPORTS_64),Yes)
21 ALL_TARGETS += libfips-64.so
27 ifeq ($(MAKECMDGOALS),)
28 ifeq ($(shell cat .first-build-message 2>/dev/null),)
29 @FIPS_FIRST_BUILD=1 $(MAKE) --no-print-directory all
31 @echo "Compilation of fips is now complete. You can install fips with:"
35 @echo "Note that depending on the prefix to which you are installing"
36 @echo "you may need root permission (such as \"sudo make install\")."
37 @echo "See \"./configure --help\" for help on setting an alternate prefix."
38 @echo Printed > .first-build-message
42 # The user has not set any verbosity, default to quiet mode and inform the
43 # user how to enable verbose compiles.
45 quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n"
46 quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)"$1 $@\n"; $($(shell echo $1 | sed -e s'/ .*//'))
48 # The user has explicitly enabled quiet compilation.
50 quiet = @printf "$1 $@\n"; $($(shell echo $1 | sed -e s'/ .*//'))
52 # Otherwise, print the full command line.
53 quiet ?= $($(shell echo $1 | sed -e s'/ .*//'))
55 %-32.o: %.c $(global_deps)
57 $(call quiet,CC $(CFLAGS) -m32) -c $(LIBFIPS_CFLAGS) -m32 $< -o $@ -MD -MP -MF .deps/$*.d
59 %-64.o: %.c $(global_deps)
61 $(call quiet,CC $(CFLAGS) -m64) -c $(LIBFIPS_CFLAGS) -m64 $< -o $@ -MD -MP -MF .deps/$*.d
63 %.o: %.c $(global_deps)
65 $(call quiet,CC $(CFLAGS)) -c $(FIPS_CFLAGS) $< -o $@ -MD -MP -MF .deps/$*.d
69 rm -rf $(CLEAN); rm -rf .deps
82 fips_modules = $(fips_srcs:.c=.o)
85 $(call quiet,$(FIPS_LINKER) $(CFLAGS)) $(FIPS_CFLAGS) $^ $(FIPS_LDFLAGS) -o $@
87 # GL-wrapper library, libfips
88 LIBRARY_LINK_FLAGS = -shared -Wl,--version-script=libfips.sym
90 extra_cflags += -I$(srcdir) -fPIC
102 ifeq ($(HAVE_EGL),Yes)
103 libfips_srcs += eglwrap.c
106 libfips.sym: extract-wrapped-symbols $(libfips_srcs)
107 $(call quiet,extract-wrapped-symbols) ./extract-wrapped-symbols $(libfips_srcs) > $@
109 libfips_32_modules = $(libfips_srcs:.c=-32.o)
111 libfips_64_modules = $(libfips_srcs:.c=-64.o)
113 libfips-32.so: $(libfips_32_modules) libfips.sym
114 $(call quiet,$(FIPS_LINKER) $(CFLAGS) -m32) -o $@ $(LIBFIPS_CFLAGS) -m32 $(libfips_32_modules) $(LIBRARY_LINK_FLAGS) $(LIBFIPS_LDFLAGS)
116 libfips-64.so: $(libfips_64_modules) libfips.sym
117 $(call quiet,$(FIPS_LINKER) $(CFLAGS) -m64) -o $@ $(LIBFIPS_CFLAGS) -m64 $(libfips_64_modules) $(LIBRARY_LINK_FLAGS) $(LIBFIPS_LDFLAGS)
121 mkdir -p $(DESTDIR)$(bindir)
122 install fips $(DESTDIR)$(bindir)/fips
123 mkdir -p $(DESTDIR)$(libdir)/fips
124 ifeq ($(COMPILER_SUPPORTS_32), Yes)
125 install -m0644 libfips-32.so $(DESTDIR)$(libdir)/fips/libfips-32.so
127 ifeq ($(COMPILER_SUPPORTS_64), Yes)
128 install -m0644 libfips-64.so $(DESTDIR)$(libdir)/fips/libfips-64.so
130 ifeq ($(MAKECMDGOALS), install)
132 @echo "Fips is now installed to $(DESTDIR)$(prefix)"
136 SRCS := $(SRCS) $(fips_srcs) $(libfips_srcs)
137 CLEAN := $(CLEAN) fips $(fips_modules) $(libfips_32_modules) $(libfips_64_modules) libfips.sym
139 DISTCLEAN := $(DISTCLEAN) .first-build-message Makefile.config
141 DEPS := $(SRCS:%.c=.deps/%.d)