File: Makefile

package info (click to toggle)
apmd 3.0final-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 688 kB
  • ctags: 641
  • sloc: ansic: 2,617; makefile: 567; sh: 240
file content (106 lines) | stat: -rw-r--r-- 3,204 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
# Makefile -- 
# Copyright 1996, 1997 Rickard E. Faith <faith@acm.org>
# Copyright 1999 Avery Pennarun <apenwarr@worldvisions.ca>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Id: Makefile,v 1.26 1999/08/03 04:26:11 apenwarr Exp $
#

VERSION=3.0final

ifneq (,)
This makefile requires GNU Make.
endif

.SUFFIXES:

OBJS=apmlib.o
EXES=apm apmd tailf xapm apmsleep
HEADERS=apm.h

PREFIX=/usr
APMD_PROXY_DIR=/etc
CC=gcc
CFLAGS=-O -g
XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include \
		-I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \
		-DVERSION=\"$(VERSION)\" \
		-DAPMD_PROXY_NAME=\"$(APMD_PROXY_DIR)/apmd_proxy\"
LDFLAGS=
XTRALDFLAGS=-L. -lapm
XLDFLAGS=-L/usr/X11R6/lib
XLIBS=-lXaw -lXmu -lXt -lXext  -lSM -lICE -lX11
LIB=libapm.a
RANLIB=ranlib

# Uncomment these lines for a production compile
#CFLAGS=-O3 -m486 -fomit-frame-pointer
#LDFLAGS=-s

all: $(EXES)

$(OBJS): $(HEADERS)

%.o: %.c
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(XTRACFLAGS) $<

%: %.o $(LIB)
	$(CC) -o $@ $< $(LDFLAGS) $(XTRALDFLAGS)

tailf: tailf.o
	$(CC)  -o $@ $< $(LDFLAGS) $(XTRALDFLAGS)

xapm.o: xapm.c
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(XTRACFLAGS) -DNARROWPROTO $<

xapm: xapm.o $(LIB)
	$(CC) -o $@ $< $(LDFLAGS) $(XTRALDFLAGS) $(XLDFLAGS) $(XLIBS)

libapm.a: $(OBJS)
	$(AR) $(ARFLAGS) $@ $(OBJS)
	$(RANLIB) $@

.PHONY:	ChangeLog
ChangeLog:
	-rm -f ChangeLog
	rcs2log > ChangeLog

install: $(EXES)
	[ -d ${PREFIX}/bin      ] || install -d ${PREFIX}/bin
	[ -d ${PREFIX}/sbin     ] || install -d ${PREFIX}/sbin
	[ -d ${PREFIX}/man/man1 ] || install -d ${PREFIX}/man/man1
	[ -d ${PREFIX}/man/man8 ] || install -d ${PREFIX}/man/man8
	[ -d ${PREFIX}/lib      ] || install -d ${PREFIX}/lib
	[ -d ${PREFIX}/include  ] || install -d ${PREFIX}/include
	[ -d ${APMD_PROXY_DIR}  ] || install -d ${APMD_PROXY_DIR}
	install        apm             ${PREFIX}/bin
	install        on_ac_power     ${PREFIX}/bin
	install -m 644 apm.1           ${PREFIX}/man/man1
	install        apmd            ${PREFIX}/sbin
	install -b -Vt apmd_proxy      ${APMD_PROXY_DIR}
	install -m 644 apmd.8          ${PREFIX}/man/man8
	install        xapm            ${PREFIX}/bin
	install -m 644 xapm.1          ${PREFIX}/man/man1/xapm.1x
	install        tailf           ${PREFIX}/bin
	install -m 644 tailf.1         ${PREFIX}/man/man1
	install        apmsleep	       ${PREFIX}/bin
	install -m 644 apmsleep.1      ${PREFIX}/man/man1
	install -m 644 libapm.a        ${PREFIX}/lib
	install -m 644 apm.h           ${PREFIX}/include

.PHONY:	clean distclean
distclean clean:
	-rm -f *.o *.s *~ core a.out build-stamp $(LIB) $(EXES)