unison

Fork of Unison, a bi-directional file synchronization tool
git clone git://git.laack.co/unison.git
Log | Files | Refs | README | LICENSE

Makefile (2395B)


      1 # Unison file synchronizer: src/Makefile
      2 # Copyright 1999-2024 (see ../LICENSE for terms).
      3 
      4 # IMPORTANT!
      5 #
      6 # This file is portable and compatible with GNU Make, BSD make, Solaris
      7 # (d)make and NMAKE. Do not make any changes in this file unless you are
      8 # certain that the changes do not break this portability.
      9 
     10 ########################################################################
     11 ########################################################################
     12 #     (There should be no need to change anything from here on)       ##
     13 ########################################################################
     14 
     15 default: all
     16 .PHONY: default
     17 
     18 # Executed only by BSD make
     19 .BEGIN:
     20 	@touch _mk.cfg
     21 	@ocaml make_tools.ml conf MAKE="$(MAKE)" > Makefile.cfg
     22 	@ocaml make_tools.ml conf2 MAKE="$(MAKE)" > Makefile2.cfg
     23 
     24 # Executed only by Solaris dmake
     25 .INIT:
     26 	@touch _mk.cfg
     27 	@ocaml make_tools.ml conf ASSUME_DMAKE=true > Makefile.cfg
     28 	@ocaml make_tools.ml conf2 ASSUME_DMAKE=true > Makefile2.cfg
     29 
     30 # Executed only by GNU Make and NMAKE
     31 Makefile.cfg: _mk.cfg
     32 	@ocaml make_tools.ml conf > Makefile.cfg
     33 	@ocaml make_tools.ml conf2 MAKE="$(MAKE)" > Makefile2.cfg
     34 _mk.cfg: ;
     35 
     36 TARGETS = all tui gui macui fsmonitor manpage docs clean depend dependgraph paths
     37 FILES = unison unison.exe
     38 
     39 .NOTPARALLEL:
     40 .PHONY: $(TARGETS)
     41 $(TARGETS) $(FILES): Makefile.cfg
     42 	$(MAKE) -f Makefile.OCaml $@
     43 
     44 # Though not ideal, recursive make is needed here, in the name of portability.
     45 #
     46 # Directly including the freshly-generated Makefile.cfg could work with GNU
     47 # Make (when the target filename in the rule is guarded by $(MAKE_RESTARTS)
     48 # to prevent gmake from going into infinite loop), but fails with all other
     49 # make implementations. Solaris make, BSD make and NMAKE all read Makefile.cfg
     50 # before generating it (failing when *.cfg does not exist, reading stale
     51 # contents otherwise). "-include" instead of "include" is not portable.
     52 
     53 
     54 ######################################################################
     55 # For developers
     56 
     57 
     58 ######################################################################
     59 # Tags
     60 
     61 ETAGS=etags
     62 
     63 # In Windows, tags and TAGS are the same, so make tags stops working
     64 # after the first invocation.  The .PHONY declaration makes it work
     65 # again.
     66 .PHONY: tags
     67 tags:
     68 	@-if command -v $(ETAGS) > /dev/null ; then \
     69 	    $(ETAGS) *.mli */*.mli *.ml */*.ml */*.m *.c */*.c *.txt \
     70 		     *Makefile* \
     71 	  ; fi
     72 
     73 TAGS: tags