]> arthur.barton.de Git - ax-make.git/blob - Makefile.ax
axify: Correctly test if the README.md file already exists
[ax-make.git] / Makefile.ax
1 #
2 # ax-make: Alex' Simple Makefile System
3 # Copyright (c)2014-2020 Alexander Barton (alex@barton.de)
4 #
5 # This library is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU Lesser General Public License as published
7 # by the Free Software Foundation; either version 2.1 of the License, or
8 # (at your option) any later version.
9 #
10
11 AX_SILENT ?= @
12
13 PREFIX ?= /usr/local
14
15 USER ?= $(shell id -un)
16 GROUP ?= $(shell stat --format=%G $(DESTDIR)$(PREFIX) 2>/dev/null || id -gn)
17
18 ifndef AX_AUTO_RECURSE_DISABLE
19 # Automatically recurse into all $(SUBDIR)s for the default target.
20 default: $(ALL) $(SUBDIRS) all-local
21 all: $(ALL) all-ax all-local
22 else
23 # Automatic recursion for default target is disabled!
24 default: $(ALL) all-local
25 all: $(ALL) all-ax all-local
26 endif
27
28 clean: clean-ax clean-local
29
30 distclean: clean-local distclean-ax distclean-local
31
32 maintainer-clean: clean-local distclean-local maintainer-clean-ax maintainer-clean-local
33
34 check: check-pre check-ax check-local check-post
35
36 install: install-ax install-local
37
38 all-ax clean-ax distclean-ax maintainer-clean-ax check-ax install-ax:
39         $(AX_SILENT)for subdir in $(SUBDIRS); do \
40           target=`echo "$@" | sed -e 's/-ax$$//'`; \
41           echo "Making \"$$target\" in \"$$subdir\" ..."; \
42           $(MAKE) -C $$subdir $$target || exit 1; \
43          done
44
45 $(SUBDIRS):
46         $(AX_SILENT)echo "Making default in \"$@\" ..."; \
47          $(MAKE) -C "$@" || exit 1
48
49 .PHONY: all clean distclean maintainer-clean check install
50 .PHONY: all-ax clean-ax distclean-ax maintainer-clean-ax check-ax install-ax
51 .PHONY: all-local clean-local distclean-local maintainer-clean-local check-local install-local
52 .PHONY: check-pre check-post
53 .PHONY: $(SUBDIRS)