[make] install man pages

Summary: `man infer` for the win!

Reviewed By: mbouaziz

Differential Revision: D5036764

fbshipit-source-id: 4567d24
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent 801c605c26
commit c10d2ed32d

1
.gitignore vendored

@ -90,6 +90,7 @@ buck-out/
#other
/infer/bin
/infer/man
/infer/src/base/Version.ml
/infer/models/java/models/

@ -136,8 +136,19 @@ ifeq ($(BUILD_C_ANALYZERS),yes)
byte src_build test_build: clang_plugin
endif
.PHONY: infer
infer: src_build
$(INFER_COMMAND_MANUALS): src_build Makefile
$(QUIET)$(MKDIR_P) $(@D)
$(QUIET)$(INFER_BIN) $(patsubst infer-%.1,%,$(@F)) --help --help-format=groff > $@
$(INFER_MANUAL): src_build Makefile
$(QUIET)$(MKDIR_P) $(@D)
$(QUIET)$(INFER_BIN) --help --help-format=groff > $@
$(INFER_MANUALS_GZIPPED): %.gz: %
$(QUIET)$(REMOVE) $@
gzip $<
infer_models: src_build
ifeq ($(BUILD_JAVA_ANALYZERS),yes)
$(QUIET)$(call silent_on_success,Building Java annotations,\
$(MAKE) -C $(ANNOTATIONS_DIR))
@ -145,6 +156,9 @@ endif
$(QUIET)$(call silent_on_success,Building Infer models,\
$(MAKE) -C $(MODELS_DIR) all)
.PHONY: infer
infer: src_build $(INFER_MANUALS) infer_models
.PHONY: clang_setup
clang_setup:
$(QUIET)export CC="$(CC)" CFLAGS="$(CFLAGS)"; \
@ -350,16 +364,20 @@ test-replace: $(BUILD_SYSTEMS_TESTS:%=build_%_replace) $(DIRECT_TESTS:%=direct_%
uninstall:
$(REMOVE_DIR) $(DESTDIR)$(libdir)/infer/
$(REMOVE) $(DESTDIR)$(bindir)/infer
$(REMOVE) $(foreach alias,$(INFER_COMMANDS),$(DESTDIR)$(bindir)/$(alias))
$(REMOVE) $(INFER_COMMANDS:%=$(DESTDIR)$(bindir)/%)
$(REMOVE) $(foreach manual,$(INFER_MANUALS_GZIPPED),\
$(DESTDIR)$(mandir)/man1/$(notdir $(manual)))
.PHONY: test_clean
test_clean: $(DIRECT_TESTS:%=direct_%_clean) $(BUILD_SYSTEMS_TESTS:%=build_%_clean)
.PHONY: install
install: infer
install: infer $(INFER_MANUALS_GZIPPED)
# create directory structure
test -d $(DESTDIR)$(bindir) || \
$(MKDIR_P) $(DESTDIR)$(bindir)
test -d $(DESTDIR)$(mandir)/man1 || \
$(MKDIR_P) $(DESTDIR)$(mandir)/man1
test -d $(DESTDIR)$(libdir)/infer/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/
ifeq ($(BUILD_C_ANALYZERS),yes)
@ -455,6 +473,9 @@ endif
(cd $(DESTDIR)$(bindir)/ && \
$(REMOVE) inferTraceBugs && \
$(LN_S) $(libdir_relative_to_bindir)/infer/infer/lib/python/inferTraceBugs inferTraceBugs)
$(QUIET)for i in $(MAN_DIR)/man1/*; do \
$(INSTALL_DATA) -C $$i $(DESTDIR)$(mandir)/man1/$$(basename $$i); \
done
ifeq ($(IS_FACEBOOK_TREE),yes)
$(QUIET)$(MAKE) -C facebook install
@ -476,7 +497,7 @@ ifeq ($(IS_FACEBOOK_TREE),yes)
endif
$(QUIET)$(MAKE) -C $(DEPENDENCIES_DIR)/ocamldot clean
find $(INFER_DIR)/tests \( -name '*.o' -o -name '*.o.sh' \) -delete
$(REMOVE_DIR) _build_logs
$(QUIET)$(REMOVE_DIR) _build_logs $(MAN_DIR)
.PHONY: conf-clean
conf-clean: clean

@ -22,6 +22,8 @@ CMAKE = @CMAKE@
CPP = @CPP@
CXX = @CXX@
CXXFLAGS = @CXXFLAGS@
# this is useless but autoconf is picky...
datarootdir = @datarootdir@
ENABLE_OCAMLOPT_CUSTOM_CC = @ENABLE_OCAMLOPT_CUSTOM_CC@
ENABLE_OCAML_BINANNOT = @ENABLE_OCAML_BINANNOT@
exec_prefix = @exec_prefix@
@ -40,6 +42,7 @@ libdir = @libdir@
# override in your `make` command to make the install relocatable
libdir_relative_to_bindir = $(libdir)
LIBS = @LIBS@
mandir = @mandir@
MENHIR = @MENHIR@
MKDIR_P_CMD = case "@MKDIR_P@" in \
./*) printf "$(ROOT_DIR)/@MKDIR_P@\n";; \

@ -36,6 +36,7 @@ ANNOTATIONS_DIR = $(INFER_DIR)/annotations
BIN_DIR = $(INFER_DIR)/bin
ETC_DIR = $(INFER_DIR)/etc
LIB_DIR = $(INFER_DIR)/lib
MAN_DIR = $(INFER_DIR)/man
MODELS_DIR = $(INFER_DIR)/models
JAVA_BUILTINS_DIR = $(MODELS_DIR)/java/builtins
JAVA_MODELS_DIR = $(MODELS_DIR)/java/src
@ -63,6 +64,11 @@ INFER_COMMANDS = \
INFERTRACEBUGS_BIN = $(BIN_DIR)/inferTraceBugs
INFERTRACEBUGS_BIN_RELPATH = infer/bin/inferTraceBugs
INFER_COMMAND_MANUALS = $(INFER_COMMANDS:%=$(MAN_DIR)/man1/%.1)
INFER_MANUAL = $(MAN_DIR)/man1/infer.1
INFER_MANUALS = $(INFER_COMMAND_MANUALS) $(INFER_MANUAL)
INFER_MANUALS_GZIPPED = $(INFER_MANUALS:=.gz)
ifeq ($(BUILD_JAVA_ANALYZERS),yes)
JAVA_HOME=$(USER_JAVA_HOME)
endif

Loading…
Cancel
Save