# -*- makefile -*- include Makefile.release # Smash together user's values with our extra values FINAL_CFLAGS = -DFIPS_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags) FINAL_FIPS_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(TALLOC_LDFLAGS) FINAL_LIBFIPS_LDFLAGS = $(LDFLAGS) -ldl FINAL_FIPS_LINKER = CC ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1) FINAL_FIPS_LDFLAGS += $(CONFIGURE_LDFLAGS) endif .PHONY: all all: fips libfips.so ifeq ($(MAKECMDGOALS),) ifeq ($(shell cat .first-build-message 2>/dev/null),) @FIPS_FIRST_BUILD=1 $(MAKE) --no-print-directory all @echo "" @echo "Compilation of fips is now complete. You can install fips with:" @echo "" @echo " make install" @echo "" @echo "Note that depending on the prefix to which you are installing" @echo "you may need root permission (such as \"sudo make install\")." @echo "See \"./configure --help\" for help on setting an alternate prefix." @echo Printed > .first-build-message endif endif .PHONY: test test: @echo "FIXME: Should consider adding a test suite here." # The user has not set any verbosity, default to quiet mode and inform the # user how to enable verbose compiles. ifeq ($(V),) quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n" quiet = @printf $(quiet_DOC)$(eval quiet_DOC:=)"$1 $@\n"; $($(shell echo $1 | sed -e s'/ .*//')) endif # The user has explicitly enabled quiet compilation. ifeq ($(V),0) quiet = @printf "$1 $@\n"; $($(shell echo $1 | sed -e s'/ .*//')) endif # Otherwise, print the full command line. quiet ?= $($(shell echo $1 | sed -e s'/ .*//')) %.o: %.c $(global_deps) @mkdir -p .deps/$(@D) $(call quiet,CC $(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@ -MD -MP -MF .deps/$*.d .PHONY : clean clean: rm -rf $(CLEAN); rm -rf .deps .PHONY: distclean distclean: clean rm -rf $(DISTCLEAN) # Main program, fips fips_srcs = \ execute.c \ fips.c fips_modules = $(fips_srcs:.c=.o) fips: $(fips_modules) $(call quiet,$(FINAL_FIPS_LINKER) $(CFLAGS)) $(FINAL_CFLAGS) $^ $(FINAL_FIPS_LDFLAGS) -o $@ # GL-wrapper library, libfips LIBRARY_LINK_FLAGS = -shared -Wl,--version-script=libfips.sym,--no-undefined extra_cflags += -I$(srcdir) -fPIC libfips_srcs = \ glxwrap.c libfips_modules = $(libfips_srcs:.c=.o) libfips.so: $(libfips_modules) libfips.sym $(call quiet,$(FINAL_FIPS_LINKER) $(CFLAGS)) $(FINAL_CFLAGS) $(libfips_modules) $(FINAL_LIBFIPS_LDFLAGS) $(LIBRARY_LINK_FLAGS) -o $@ .PHONY: install install: all mkdir -p $(DESTDIR)$(bindir) install fips $(DESTDIR)$(bindir)/fips mkdir -p $(DESTDIR)$(libdir)/fips install -m0644 libfips.so $(DESTDIR)$(libdir)/fips/libfips.so ifeq ($(MAKECMDGOALS), install) @echo "" @echo "Fips is now installed to $(DESTDIR)$(prefix)" @echo "" endif SRCS := $(SRCS) $(fips_srcs) $(libfips_srcs) CLEAN := $(CLEAN) fips $(fips_modules) $(libfips_modules) DISTCLEAN := $(DISTCLEAN) .first-build-message Makefile.config DEPS := $(SRCS:%.c=.deps/%.d) DEPS := $(DEPS:%.cc=.deps/%.d) -include $(DEPS)