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.

Remove the recursive invocation in install targets

+67 -47
+67 -47
Makefile
··· 2761 2761 middle_end middle_end/closure middle_end/flambda middle_end/flambda/base_types 2762 2762 2763 2763 # Installation 2764 + # Historically, the install target dynamically installed what had been built, 2765 + # for example, if only world had been built then make install simply didn't 2766 + # install the native tools. That infrastructure is potentially convenient when 2767 + # working on the compiler, but potentially masks bugs. It is better to have the 2768 + # installation targets require everything configure mandated to have built. 2769 + # There are three entry points to installation: 2770 + # install - installs everything 2771 + # installopt - installs the native code compiler _and_ the extra .opt tools 2772 + # installoptopt - installs just the extra .opt tools 2773 + # The installopt targets have been maintained for now, but may be removed in the 2774 + # future. 2764 2775 2765 - .PHONY: install 2766 - install:: 2776 + ifeq "$(NATIVE_COMPILER)" "true" 2777 + install: full-installoptopt ; 2778 + else 2779 + install: common-install ; 2780 + endif 2781 + 2782 + # These three targets are the slightly esoteric special sauce that avoid 2783 + # recursive make invocations in the install targets. 2784 + # There are three basic install recipes: 2785 + # - The old install target is available to common-install, but never recurses to 2786 + # installopt 2787 + # - The old installopt target is available as both full-installopt and 2788 + # native-install 2789 + # - The old installoptopt target is also available as full-installoptopt and 2790 + # installopt 2791 + # These sets of recipes are then welded together by these three dependency 2792 + # specifications 2793 + # - When configured with --disable-native-compiler, the install target simply 2794 + # depends on common-install (see above) 2795 + # - Otherwise, install depends on full-installoptopt (see above) 2796 + # - The recipe for full-installoptopt installs the .opt versions of the tools, 2797 + # but it _depends on_ full-installopt. 2798 + # - full-installopt installs the native compiler, but it _depends on_ 2799 + # common-install 2800 + installopt: native-install 2801 + 2802 + full-installopt:: common-install 2803 + 2804 + full-installoptopt: full-installopt 2805 + 2806 + .PHONY: common-install 2807 + common-install:: 2767 2808 $(MKDIR) "$(INSTALL_BINDIR)" 2768 2809 $(MKDIR) "$(INSTALL_LIBDIR)" 2769 2810 ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" ··· 2783 2824 endif 2784 2825 2785 2826 define INSTALL_RUNTIME 2786 - install:: 2827 + common-install:: 2787 2828 $(INSTALL_PROG) \ 2788 2829 runtime/$(1)$(EXE) \ 2789 2830 "$(INSTALL_BINDIR)/$(call MANGLE_RUNTIME_NAME,$(1))" ··· 2797 2838 endef 2798 2839 define INSTALL_RUNTIME_LIB 2799 2840 ifeq "$(2)" "BYTECODE" 2800 - install:: 2841 + common-install:: 2801 2842 else 2802 - installopt:: 2843 + full-installopt native-install:: 2803 2844 endif 2804 2845 $(INSTALL_PROG) \ 2805 2846 runtime/lib$(1)_shared$(EXT_DLL) \ ··· 2814 2855 $(foreach runtime, $(runtime_PROGRAMS), \ 2815 2856 $(eval $(call INSTALL_RUNTIME,$(runtime)))) 2816 2857 2817 - install:: 2858 + common-install:: 2818 2859 $(INSTALL_DATA) runtime/ld.conf $(runtime_BYTECODE_STATIC_LIBRARIES) \ 2819 2860 "$(INSTALL_LIBDIR)" 2820 2861 2821 2862 $(foreach shared_runtime, $(runtime_BYTECODE_SHARED_LIBRARIES), \ 2822 2863 $(eval $(call INSTALL_RUNTIME_LIB,$(shared_runtime),BYTECODE))) 2823 2864 2824 - install:: 2865 + common-install:: 2825 2866 $(INSTALL_DATA) runtime/caml/domain_state.tbl runtime/caml/*.h \ 2826 2867 "$(INSTALL_LIBDIR_CAML)" 2827 2868 $(INSTALL_PROG) ocaml$(EXE) "$(INSTALL_BINDIR)" ··· 2832 2873 $(MAKE) -C stdlib install 2833 2874 2834 2875 define INSTALL_ONE_NAT_TOOL 2835 - install:: 2876 + common-install:: 2836 2877 ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" 2837 2878 $(INSTALL_PROG) "tools/$(1)$(EXE)" "$(INSTALL_BINDIR)/$(1).byte$(EXE)" 2838 2879 endif 2839 - $(if $(wildcard tools/$(1).opt$(EXE)), \ 2840 - $(INSTALL_PROG) "tools/$(1).opt$(EXE)" "$(INSTALL_BINDIR)") 2880 + ifeq "$(NATIVE_COMPILER)" "true" 2881 + $(INSTALL_PROG) "tools/$(1).opt$(EXE)" "$(INSTALL_BINDIR)" 2882 + endif 2841 2883 (cd "$(INSTALL_BINDIR)" && \ 2842 - $(LN) "$(1).$(if $(wildcard tools/$(1).opt$(EXE)),opt,byte)$(EXE)" \ 2884 + $(LN) "$(1).$(if $(filter true, $(NATIVE_COMPILER)),opt,byte)$(EXE)" \ 2843 2885 "$(1)$(EXE)") 2844 2886 endef 2845 2887 2846 2888 ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" 2847 - install:: 2889 + common-install:: 2848 2890 $(INSTALL_PROG) lex/ocamllex$(EXE) \ 2849 2891 "$(INSTALL_BINDIR)/ocamllex.byte$(EXE)" 2850 2892 endif ··· 2853 2895 $(eval $(call INSTALL_ONE_NAT_TOOL,$(tool)))) 2854 2896 2855 2897 define INSTALL_ONE_BYT_TOOL 2856 - install:: 2898 + common-install:: 2857 2899 $(INSTALL_PROG) "tools/$(1)$(EXE)" "$(INSTALL_BINDIR)" 2858 2900 endef 2859 2901 2860 2902 $(foreach tool, $(TOOLS_TO_INSTALL_BYT), \ 2861 2903 $(eval $(call INSTALL_ONE_BYT_TOOL,$(tool)))) 2862 2904 2863 - install:: 2905 + common-install:: 2864 2906 $(INSTALL_PROG) $(ocamlyacc_PROGRAM)$(EXE) "$(INSTALL_BINDIR)" 2865 2907 $(INSTALL_DATA) \ 2866 2908 $(call COMPILER_ARTEFACT_DIRS, *.cmi) \ ··· 2944 2986 endif # ifeq "$(BOOTSTRAPPING_FLEXDLL)" "true" 2945 2987 $(INSTALL_DATA) Makefile.config "$(INSTALL_LIBDIR)" 2946 2988 $(INSTALL_DATA) $(DOC_FILES) "$(INSTALL_DOCDIR)" 2947 - $(MAKE) install$(if $(wildcard ocamlopt$(EXE)),opt,-mklinks) 2948 - 2949 - # Ensure the symlinks are created if the user configures for the native 2950 - # compiler but then doesn't build opt (legacy installation only) 2951 - .PHONY: install-mklinks 2952 - install-mklinks: 2953 - ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" 2989 + ifeq "$(NATIVE_COMPILER)-$(INSTALL_BYTECODE_PROGRAMS)" "false-true" 2954 2990 cd "$(INSTALL_BINDIR)"; \ 2955 2991 $(LN) ocamlc.byte$(EXE) ocamlc$(EXE); \ 2956 2992 $(LN) ocamllex.byte$(EXE) ocamllex$(EXE); \ ··· 2959 2995 endif 2960 2996 2961 2997 # Installation of the native-code compiler 2962 - .PHONY: installopt 2963 - installopt:: 2998 + .PHONY: full-installopt native-install 2999 + full-installopt native-install:: 2964 3000 $(INSTALL_DATA) $(runtime_NATIVE_STATIC_LIBRARIES) "$(INSTALL_LIBDIR)" 2965 3001 2966 3002 $(foreach shared_runtime, $(runtime_NATIVE_SHARED_LIBRARIES), \ 2967 3003 $(eval $(call INSTALL_RUNTIME_LIB,$(shared_runtime),NATIVE))) 2968 3004 2969 - installopt:: 3005 + full-installopt native-install:: 2970 3006 ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" 2971 3007 $(call STRIP_BYTE_PROG, ocamlopt$(EXE)) 2972 3008 $(INSTALL_PROG) \ ··· 3009 3045 $(ocamlopt_CMO_FILES) \ 3010 3046 "$(INSTALL_LIBDIR_COMPILERLIBS)" 3011 3047 ifeq "$(build_ocamldoc)" "true" 3012 - $(if $(wildcard ocamldoc/ocamldoc.opt$(EXE)), \ 3013 - $(INSTALL_PROG) ocamldoc/ocamldoc.opt$(EXE) "$(INSTALL_BINDIR)") 3014 - $(if $(wildcard ocamldoc/ocamldoc.opt$(EXE)), \ 3015 - $(INSTALL_DATA) \ 3016 - ocamldoc/*.cmx ocamldoc/odoc_info.$(A) \ 3017 - ocamldoc/odoc_info.cmxa \ 3018 - "$(INSTALL_LIBDIR_OCAMLDOC)") 3048 + $(INSTALL_PROG) ocamldoc/ocamldoc.opt$(EXE) "$(INSTALL_BINDIR)" 3049 + $(INSTALL_DATA) \ 3050 + ocamldoc/*.cmx ocamldoc/odoc_info.$(A) \ 3051 + ocamldoc/odoc_info.cmxa \ 3052 + "$(INSTALL_LIBDIR_OCAMLDOC)" 3019 3053 endif 3020 3054 ifeq "$(strip $(NATDYNLINK))" "true" 3021 3055 $(INSTALL_DATA) \ ··· 3026 3060 for i in $(OTHERLIBS); do \ 3027 3061 $(MAKE) -C otherlibs/$$i installopt || exit $$?; \ 3028 3062 done 3029 - $(MAKE) installopt$(if $(wildcard ocamlopt.opt$(EXE)),opt,-mklinks) 3030 3063 $(INSTALL_DATA) \ 3031 3064 tools/profiling.cmx tools/profiling.$(O) \ 3032 3065 "$(INSTALL_LIBDIR_PROFILING)" 3033 3066 3034 - # Ensure the symlinks are created if the user configures for the native 3035 - # compiler but then doesn't build opt.opt (legacy installation only) 3036 - .PHONY: install-mklinks 3037 - installopt-mklinks: 3038 - ifeq "$(INSTALL_BYTECODE_PROGRAMS)" "true" 3039 - cd "$(INSTALL_BINDIR)"; \ 3040 - $(LN) ocamlc.byte$(EXE) ocamlc$(EXE); \ 3041 - $(LN) ocamlopt.byte$(EXE) ocamlopt$(EXE); \ 3042 - $(LN) ocamllex.byte$(EXE) ocamllex$(EXE); \ 3043 - (test -f flexlink.byte$(EXE) && \ 3044 - $(LN) flexlink.byte$(EXE) flexlink$(EXE)) || true 3045 - endif 3046 - 3047 - .PHONY: installoptopt 3048 - installoptopt: 3067 + .PHONY: full-installoptopt installopt installoptopt 3068 + full-installoptopt installopt installoptopt: 3049 3069 $(INSTALL_PROG) ocamlc.opt$(EXE) "$(INSTALL_BINDIR)" 3050 3070 $(INSTALL_PROG) ocamlopt.opt$(EXE) "$(INSTALL_BINDIR)" 3051 3071 $(INSTALL_PROG) lex/ocamllex.opt$(EXE) "$(INSTALL_BINDIR)"