Add to git.
[makeplus.git] / main.mk
1 # This is make+. Make+ is a set of scripts which enhance GNU make and
2 # let ou build RPMs, and other packages types with just one control
3 # file. Read more at http://www.annexia.org/freeware/makeplus/
4 #
5 # The original author is Richard W.M. Jones <rich@annexia.org>.
6 #
7 # This software has been explicitly placed in the PUBLIC DOMAIN.  You
8 # do not need any sort of license or agreement to use or copy this
9 # software. You may also copyright this software yourself, and/or
10 # relicense it under any terms you want, at any time and at no cost.
11 # This allows you (among other things) to include this software with
12 # other packages so that the user does not need to download and
13 # install make+ separately.
14
15 # This is a hack to make GNU make recognise '_mp_all (all)' as the
16 # default goal.
17 include $(MAKEPLUS_HOME)/default_goal.mk
18
19 # Set the VPATH because builds always happen in a subdirectory.
20 VPATH           := ..
21 srcdir          := $(shell cd .. && pwd)
22
23 # Directories.
24 prefix          ?= /usr/local
25 bindir          = $(prefix)/bin
26 sbindir         = $(prefix)/sbin
27 libexecdir      = $(prefix)/libexec
28 datadir         = $(prefix)/share
29 sysconfdir      = $(prefix)/etc
30 sharedstatedir  = $(prefix)/com
31 localstatedir   = $(prefix)/var
32 libdir          = $(prefix)/lib
33 infodir         = $(prefix)/info
34 includedir      = $(prefix)/include
35 pkgdatadir      = $(datadir)/$(PACKAGE)
36 docdir          = $(datadir)/doc/$(PACKAGE)-$(VERSION)
37 pkgetcdir       = $(sysconfdir)/$(PACKAGE)
38 pkglibdir       = $(libdir)/$(PACKAGE)
39 pkgincludedir   = $(includedir)/$(PACKAGE)
40 ifneq ($(shell uname), FreeBSD)
41 manprefix       = $(datadir)
42 else
43 manprefix       = $(prefix)
44 endif
45 mandir          = $(manprefix)/man
46 man1dir         = $(mandir)/man1
47 man2dir         = $(mandir)/man2
48 man3dir         = $(mandir)/man3
49 man4dir         = $(mandir)/man4
50 man5dir         = $(mandir)/man5
51 man6dir         = $(mandir)/man6
52 man7dir         = $(mandir)/man7
53 man8dir         = $(mandir)/man8
54 manndir         = $(mandir)/mann
55 manldir         = $(mandir)/manl
56
57 # If the configuration file exists, include it (from the build directory).
58 -include config.mk
59
60 # Include the other parts of this makefile.
61 include $(MAKEPLUS_HOME)/configure.mk
62 include $(MAKEPLUS_HOME)/c.mk
63 include $(MAKEPLUS_HOME)/dist.mk
64 include $(MAKEPLUS_HOME)/rpm.mk
65 include $(MAKEPLUS_HOME)/test.mk
66 include $(MAKEPLUS_HOME)/website.mk
67
68 # Clean rule (removes files and links in the build directory and removes
69 # editor backup files from the source directory).
70 clean:
71         [ -f $(srcdir)/$(_mp_makefile) ]
72         find . \( -type f -o -type l \) -print | xargs rm -f
73         find .. -name '*~' -print | xargs rm -f
74
75 # Distclean rule (does a clean and additionally removes the build directory).
76 distclean: clean
77         cd .. && rm -rf $(_mp_builddir)
78
79 # Force target.
80 _mp_force:
81
82 # Export everything.
83 .EXPORT_ALL_VARIABLES:
84
85 # Phony targets.
86 .PHONY: clean configure distclean