File: Makefile.common

package info (click to toggle)
grap 1.39-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 820 kB
  • ctags: 584
  • sloc: cpp: 3,024; yacc: 1,063; lex: 1,004; makefile: 187; sh: 168; awk: 5
file content (121 lines) | stat: -rw-r--r-- 2,966 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# -*-makefile-*-
# This file is (c) 2001 Ted Faber (faber@lunabase.org) see COPYRIGHT
# for the full copyright and limitations of liabilities.

# Some standard	targets are defined below.  The parameters that need
# to be defined for these to work are:
# PROGS			programs to make
# DISTDIR		the name of the directory in which tarred files appear
# RM			the file deletion command.  rm -f is usual.
# OBJS			object files.  Can be null, removed on make clean
# MAKE			make should set it.
# MKDEP			make depend program
# MKDEPFLAGS		arguments to mkdep
# LD			program to link .o -> executables
# CLEANFILES		files to remove on make clean beyond the defaults
# VERYCLEANFILES	files to remove on make veryclean beyond the defaults
# SPOTLESSFILES		files to remove on make spotless beyond the defaults


# solaris make uses these as defaults:

CCC=$(CXX)
CCFLAGS=$(CXXFLAGS)

PREMKDEP?=@true
POSTMKDEP?=@true
ALL?=${PROGS}

.SUFFIXES:	.doc .an

all:	.depend ${ALL}

manifest:	manifest.in
	sed 's/^/${DISTDIR}\//;' < manifest.in > manifest

dist:	manifest 
	${RM} -r /tmp/${DISTDIR} && mkdir /tmp/${DISTDIR}
	tar cf - . | (cd /tmp/${DISTDIR} && tar xf - )
	cd /tmp && tar --create --gzip --file ${DISTDIR}.tar.gz \
		 --files-from ${DISTDIR}/manifest --dereference
	mv /tmp/${DISTDIR}.tar.gz .
	${RM} -r /tmp/${DISTDIR}

clean:
	${MAKE} cleancore
	${RM} ${PROGS} ${OBJS} ${DISTDIR}.tar.gz *.core core ${CLEANFILES}

cleancore:
	${RM} *.core core 

cleanconfig:
	${RM} config.log config.status config.cache 

cleandepend:
	cat < /dev/null > .depend
	touch -t 9912311000 .depend > /dev/null 2>&1 || ( sleep 1; touch Makefile)

cleanautoconf:
	${RM} -r autom4te.cache

veryclean:
	${MAKE} clean cleantags
	${RM} ${VERYCLEANFILES} 

distclean:
	${MAKE} veryclean
	${MAKE} cleanconfig
	${RM} Makefile .depend config.h manifest ${SPOTLESSFILES}

spotless:
	${MAKE} veryclean
	${MAKE} cleanconfig
	${MAKE} cleanautoconf
	${RM} Makefile .depend configure config.h manifest ${SPOTLESSFILES}

depend:	.depend

newdepend:	cleandepend depend

.depend:	Makefile
	${PREMKDEP}
	${MKDEP} ${MKDEPFLAGS}
	${POSTMKDEP}

tags:	${TAGFILES}
	${CTAGS} ${CTAGSFLAGS} ${TAGFILES}

cleantags:
	${RM} tags

# pattern rules for c++ compilation and linking.  The *.o ->
# executable rules are for times when c++ generated .o files are made
# into executables.  The linker muse be overlaid with a C++ aware
# linker (usually the C++ complier).

# pmake
.NULL:	.out

.cc.out:
	${CXX} ${CXXFLAGS} ${LDFLAGS} -o $@ ${.IMPSRC} ${LDLIBS}

.o.out:
	${LD} ${LDFLAGS} -o $@ ${.ALLSRC} ${LDLIBS}

#GNU Make
.cc:
	${CXX} ${CXXFLAGS} ${LDFLAGS} -o $@ $< ${LDLIBS}

.o:
	${LD} ${LDFLAGS} -o $@ $^ ${LDLIBS}

# create a -man macro formatted manpage.  This only works if rosetta man
# is available, and should be done on my system prior to dist.
.doc.an:	
	groff -Tascii -mdoc $< | rman -f roff > $@

# Some of the standard GNU targets to make some people's lives easier

mostlyclean:	clean
maintainer-clean:	veryclean