The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Eliminate local if blocks in install

+56 -60
+41 -41
Makefile
··· 2825 2825 define INSTALL_ONE_NAT_TOOL 2826 2826 install:: 2827 2827 ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" 2828 - $(INSTALL_PROG) "tools/$(1)$(EXE)" "$(INSTALL_BINDIR)/$(1).byte$(EXE)";\ 2829 - if test -f "tools/$(1)".opt$(EXE); then \ 2830 - $(INSTALL_PROG) "tools/$(1).opt$(EXE)" "$(INSTALL_BINDIR)" && \ 2831 - (cd "$(INSTALL_BINDIR)" && $(LN) "$(1).opt$(EXE)" "$(1)$(EXE)"); \ 2832 - else \ 2833 - (cd "$(INSTALL_BINDIR)" && $(LN) "$(1).byte$(EXE)" "$(1)$(EXE)"); \ 2834 - fi 2835 - else 2836 - if test -f "tools/$(1)".opt$(EXE); then \ 2837 - $(INSTALL_PROG) "tools/$(1).opt$(EXE)" "$(INSTALL_BINDIR)"; \ 2838 - (cd "$(INSTALL_BINDIR)" && $(LN) "$(1).opt$(EXE)" "$(1)$(EXE)"); \ 2839 - fi 2828 + $(INSTALL_PROG) "tools/$(1)$(EXE)" "$(INSTALL_BINDIR)/$(1).byte$(EXE)" 2840 2829 endif 2830 + $(if $(wildcard tools/$(1).opt$(EXE)), \ 2831 + $(INSTALL_PROG) "tools/$(1).opt$(EXE)" "$(INSTALL_BINDIR)") 2832 + (cd "$(INSTALL_BINDIR)" && \ 2833 + $(LN) "$(1).$(if $(wildcard tools/$(1).opt$(EXE)),opt,byte)$(EXE)" \ 2834 + "$(1)$(EXE)") 2841 2835 endef 2842 2836 2843 2837 ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" ··· 2938 2932 ifeq "$(build_libraries_manpages)" "true" 2939 2933 $(MAKE) -C api_docgen install 2940 2934 endif 2941 - if test -n "$(WITH_DEBUGGER)"; then \ 2942 - $(INSTALL_PROG) debugger/ocamldebug$(EXE) "$(INSTALL_BINDIR)"; \ 2943 - fi 2935 + ifneq "$(WITH_DEBUGGER)" "" 2936 + $(INSTALL_PROG) debugger/ocamldebug$(EXE) "$(INSTALL_BINDIR)" 2937 + endif 2944 2938 ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" 2945 2939 ifeq "$(TOOLCHAIN)" "msvc" 2946 2940 $(INSTALL_DATA) $(FLEXDLL_SOURCE_DIR)/$(FLEXDLL_MANIFEST) \ ··· 2955 2949 endif # ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" 2956 2950 $(INSTALL_DATA) Makefile.config "$(INSTALL_LIBDIR)" 2957 2951 $(INSTALL_DATA) $(DOC_FILES) "$(INSTALL_DOCDIR)" 2952 + $(MAKE) install$(if $(wildcard ocamlopt$(EXE)),opt,-mklinks) 2953 + 2954 + # Ensure the symlinks are created if the user configures for the native 2955 + # compiler but then doesn't build opt (legacy installation only) 2956 + .PHONY: install-mklinks 2957 + install-mklinks: 2958 2958 ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" 2959 - if test -f ocamlopt$(EXE); then $(MAKE) installopt; else \ 2960 - cd "$(INSTALL_BINDIR)"; \ 2961 - $(LN) ocamlc.byte$(EXE) ocamlc$(EXE); \ 2962 - $(LN) ocamllex.byte$(EXE) ocamllex$(EXE); \ 2963 - (test -f flexlink.byte$(EXE) && \ 2964 - $(LN) flexlink.byte$(EXE) flexlink$(EXE)) || true; \ 2965 - fi 2966 - else 2967 - if test -f ocamlopt$(EXE); then $(MAKE) installopt; fi 2959 + cd "$(INSTALL_BINDIR)"; \ 2960 + $(LN) ocamlc.byte$(EXE) ocamlc$(EXE); \ 2961 + $(LN) ocamllex.byte$(EXE) ocamllex$(EXE); \ 2962 + (test -f flexlink.byte$(EXE) && \ 2963 + $(LN) flexlink.byte$(EXE) flexlink$(EXE)) || true 2968 2964 endif 2969 2965 2970 2966 # Installation of the native-code compiler ··· 3023 3019 $(ocamlopt_CMO_FILES) \ 3024 3020 "$(INSTALL_COMPLIBDIR)" 3025 3021 ifeq "$(build_ocamldoc)" "true" 3026 - $(INSTALL_PROG) ocamldoc/ocamldoc.opt$(EXE) "$(INSTALL_BINDIR)" 3027 - $(INSTALL_DATA) \ 3028 - ocamldoc/*.cmx ocamldoc/odoc_info.$(A) \ 3029 - ocamldoc/odoc_info.cmxa \ 3030 - "$(INSTALL_LIBDIR)/ocamldoc" 3022 + $(if $(wildcard ocamldoc/ocamldoc.opt$(EXE)), \ 3023 + $(INSTALL_PROG) ocamldoc/ocamldoc.opt$(EXE) "$(INSTALL_BINDIR)") 3024 + $(if $(wildcard ocamldoc/ocamldoc.opt$(EXE)), \ 3025 + $(INSTALL_DATA) \ 3026 + ocamldoc/*.cmx ocamldoc/odoc_info.$(A) \ 3027 + ocamldoc/odoc_info.cmxa \ 3028 + "$(INSTALL_LIBDIR)/ocamldoc") 3031 3029 endif 3032 3030 ifeq "$(strip $(NATDYNLINK))" "true" 3033 3031 $(INSTALL_DATA) \ ··· 3038 3036 for i in $(OTHERLIBS); do \ 3039 3037 $(MAKE) -C otherlibs/$$i installopt || exit $$?; \ 3040 3038 done 3041 - ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" 3042 - if test -f ocamlopt.opt$(EXE); then $(MAKE) installoptopt; else \ 3043 - cd "$(INSTALL_BINDIR)"; \ 3044 - $(LN) ocamlc.byte$(EXE) ocamlc$(EXE); \ 3045 - $(LN) ocamlopt.byte$(EXE) ocamlopt$(EXE); \ 3046 - $(LN) ocamllex.byte$(EXE) ocamllex$(EXE); \ 3047 - (test -f flexlink.byte$(EXE) && \ 3048 - $(LN) flexlink.byte$(EXE) flexlink$(EXE)) || true; \ 3049 - fi 3050 - else 3051 - if test -f ocamlopt.opt$(EXE); then $(MAKE) installoptopt; fi 3052 - endif 3039 + $(MAKE) installopt$(if $(wildcard ocamlopt.opt$(EXE)),opt,-mklinks) 3053 3040 $(INSTALL_DATA) \ 3054 3041 tools/profiling.cmx tools/profiling.$(O) \ 3055 3042 "$(INSTALL_LIBDIR_PROFILING)" 3043 + 3044 + # Ensure the symlinks are created if the user configures for the native 3045 + # compiler but then doesn't build opt.opt (legacy installation only) 3046 + .PHONY: install-mklinks 3047 + installopt-mklinks: 3048 + ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" 3049 + cd "$(INSTALL_BINDIR)"; \ 3050 + $(LN) ocamlc.byte$(EXE) ocamlc$(EXE); \ 3051 + $(LN) ocamlopt.byte$(EXE) ocamlopt$(EXE); \ 3052 + $(LN) ocamllex.byte$(EXE) ocamllex$(EXE); \ 3053 + (test -f flexlink.byte$(EXE) && \ 3054 + $(LN) flexlink.byte$(EXE) flexlink$(EXE)) || true 3055 + endif 3056 3056 3057 3057 .PHONY: installoptopt 3058 3058 installoptopt:
+2 -3
api_docgen/ocamldoc/Makefile
··· 122 122 .PHONY: install 123 123 install: 124 124 $(MKDIR) "$(INSTALL_LIBRARIES_MAN_DIR)" 125 - if test -d build/man; then \ 126 - $(INSTALL_DATA) build/man/*.3o "$(INSTALL_LIBRARIES_MAN_DIR)"; \ 127 - fi 125 + $(if $(wildcard build/man), \ 126 + $(INSTALL_DATA) build/man/*.3o "$(INSTALL_LIBRARIES_MAN_DIR)")
+4 -6
api_docgen/odoc/Makefile
··· 192 192 .PHONY: install 193 193 install: 194 194 $(MKDIR) "$(INSTALL_LIBRARIES_MAN_DIR)" 195 - if test -d build/man/libref ; then \ 196 - $(INSTALL_DATA) build/man/libref/* "$(INSTALL_LIBRARIES_MAN_DIR)"; \ 197 - fi 198 - if test -d build/man/compilerlibref ; then \ 199 - $(INSTALL_DATA) build/man/libref/* "$(INSTALL_LIBRARIES_MAN_DIR)"; \ 200 - fi 195 + $(if $(wildcard build/man/libref), \ 196 + $(INSTALL_DATA) build/man/libref/* "$(INSTALL_LIBRARIES_MAN_DIR)") 197 + $(if $(wildcard build/man/compilerlibref), \ 198 + $(INSTALL_DATA) build/man/libref/* "$(INSTALL_LIBRARIES_MAN_DIR)") 201 199 202 200 # Dependencies for stdlib modules. 203 201 # Use the same dependencies used for compiling .cmx files.
+9 -10
otherlibs/Makefile.otherlibs.common
··· 134 134 $(CMIFILES:.cmi=.cmti) \ 135 135 "$(INSTALL_LIBDIR_LIBNAME)/" 136 136 endif 137 - if test -n "$(HEADERS)"; then \ 138 - $(INSTALL_DATA) $(HEADERS) "$(INSTALL_INCDIR)/"; \ 139 - fi 137 + ifneq "$(HEADERS)" "" 138 + $(INSTALL_DATA) $(HEADERS) "$(INSTALL_INCDIR)/" 139 + endif 140 140 141 141 installopt: 142 142 $(INSTALL_DATA) \ 143 143 $(CAMLOBJS_NAT) $(LIBNAME).cmxa $(LIBNAME).$(A) \ 144 144 "$(INSTALL_LIBDIR_LIBNAME)/" 145 - if test -f $(LIBNAME).cmxs; then \ 146 - $(INSTALL_PROG) $(LIBNAME).cmxs "$(INSTALL_LIBDIR_LIBNAME)"; \ 147 - fi 148 - if test -f dll$(CLIBNAME_NATIVE)$(EXT_DLL); then \ 149 - $(INSTALL_PROG) \ 150 - dll$(CLIBNAME_NATIVE)$(EXT_DLL) "$(INSTALL_STUBLIBDIR)"; \ 151 - fi 145 + ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" 146 + $(INSTALL_PROG) $(LIBNAME).cmxs "$(INSTALL_LIBDIR_LIBNAME)" 147 + ifeq "$(SUFFIXING)" "false" 148 + $(INSTALL_PROG) dll$(CLIBNAME_NATIVE)$(EXT_DLL) "$(INSTALL_STUBLIBDIR)" 149 + endif 150 + endif 152 151 ifneq "$(STUBSLIB_NATIVE)" "" 153 152 $(INSTALL_DATA) $(STUBSLIB_NATIVE) "$(INSTALL_LIBDIR)/" 154 153 endif