File: Makefile

package info (click to toggle)
exim 2.05-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 4,520 kB
  • ctags: 2,992
  • sloc: ansic: 42,424; perl: 1,349; sh: 843; makefile: 321
file content (58 lines) | stat: -rw-r--r-- 2,333 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Top-level makefile for Exim; handles creating a build directory with
# appropriate links, and then running the default makefile in that directory.

# Copyright (c) 1996 University of Cambridge.
# See the file NOTICE for conditions of use and distribution.

# IRIX make uses the shell that is in the SHELL variable, which often defaults
# to csh, so put this in to make it use the Bourne shell. In systems where
# /bin/sh is not a Bourne-compatible shell, this line will have to be edited.

SHELL=/bin/sh

# If a build name has not been specified by running this make file via a
# command of the form "make build=xxxx", then determine the name of the
# operating system and the machine architecture and use that.

buildname=$${build:-`scripts/os-type`-`scripts/arch-type`}

# The default target tests for the existence of the build directory, and
# if is not present, creates it and use the MakeLinks script to put in
# symbolic links to the relevant source files. It then checks for the
# presence of a makefile in the build directory - this can get removed
# by some kinds of failure. It it's not there, it puts back a link to the
# base makefile, so that it will get rebuilt. Then it cd's to the build
# directory and runs make there.

all: build-directory go

# This is separated off so that "make build-directory" can be obeyed on
# its own if necessary.

build-directory:
	@builddir=build-$(buildname); \
	case "$$builddir" in *UnKnown*) exit 1;; esac; \
	sh -c "test -d $$builddir || (mkdir $$builddir; cd $$builddir; ../scripts/MakeLinks)"; \
	sh -c "test -r $$builddir/makefile -o -r $$builddir/Makefile || (cd $$builddir; ln -s ../OS/Makefile-Base Makefile;)"

# Go to the build directory and do the business

go:;	cd build-$(buildname); $(MAKE) SHELL=$(SHELL) $(MFLAGS)

# The "install" and "clean" targets just pass themselves on to the build
# directory make file.

install clean:
	cd build-$(buildname); $(MAKE) $(MFLAGS) $@

# The "makefile" or "configure" target removes the build directory's make file,
# puts back a link to the default make file, and runs it, which has the effect
# of rebuilding the tailored make file.

makefile configure: build-directory
	cd build-$(buildname); \
	rm -f ?akefile; \
	ln -s ../OS/Makefile-Base Makefile; \
	$(MAKE) SHELL=$(SHELL) $(MFLAGS) makefile

# End of top-level makefile