1 #**************************************************************************
2 #* *
3 #* OCaml *
4 #* *
5 #* Gabriel Scherer, projet Parsifal, INRIA Saclay *
6 #* *
7 #* Copyright 2018 Institut National de Recherche en Informatique et *
8 #* en Automatique. *
9 #* *
10 #* All rights reserved. This file is distributed under the terms of *
11 #* the GNU Lesser General Public License version 2.1, with the *
12 #* special exception on linking described in the file LICENSE. *
13 #* *
14 #**************************************************************************
15
16 ROOTDIR=..
17 include $(ROOTDIR)/Makefile.config
18 include $(ROOTDIR)/Makefile.common
19
20 # $1: target name to dispatch to all otherlibs/*/Makefile
21 define dispatch_
22 $1:
23 @for lib in $$(OTHERLIBRARIES); do \
24 ($$(MAKE) -C $$$$lib $1) || exit $$$$?; \
25 done
26 endef
27 define dispatch
28 $(eval $(call dispatch_,$1))
29 endef
30
31 .PHONY: all allopt clean partialclean
32 $(call dispatch,all)
33 $(call dispatch,allopt)
34 $(call dispatch,clean)
35 $(call dispatch,partialclean)
36