File: Makefile

package info (click to toggle)
apmd 3.2.2-15
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 508 kB
  • sloc: ansic: 2,884; makefile: 594; sh: 192
file content (116 lines) | stat: -rw-r--r-- 3,270 bytes parent folder | download | duplicates (4)
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
# 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.30 2001/11/25 22:46:16 apenwarr Exp $
#

VERSION=3.2.1
LIB_VERSION=1:0

ifneq (,)
This makefile requires GNU Make.
endif

.SUFFIXES:

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

PREFIX=/usr
MANDIR=$(PREFIX)/man
BINDIR=$(PREFIX)/bin
SBINDIR=$(PREFIX)/sbin
LIBDIR=$(PREFIX)/lib
INCDIR=$(PREFIX)/include
PROXY_DIR=/etc
DESTDIR=

CC=gcc
CFLAGS=-O -g
XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \
		-I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \
		-DVERSION=\"$(VERSION)\" \
		-DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\"
LDFLAGS=
LIBAPM=libapm.la
LIBAPM_FLAGS=-rpath $(LIBDIR) -version-info $(LIB_VERSION)
XLDFLAGS=-L/usr/X11R6/lib
XLIBS=-lXaw -lXmu -lXt -lXext -lSM -lICE -lX11
RANLIB=ranlib

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

LIBTOOL=libtool --quiet
LT_COMPILE = $(LIBTOOL) --mode=compile $(CC)
LT_LINK = $(LIBTOOL) --mode=link $(CC)
LT_INSTALL = $(LIBTOOL) --mode=install install
LT_CLEAN = $(LIBTOOL) --mode=clean rm

all: $(EXES)

$(OBJS): $(HEADERS)

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

%: %.o $(LIBAPM)
	$(LT_LINK) -o $@ $< $(LDFLAGS) $(LIBAPM)

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

apmd: apmd.o

apmsleep: apmsleep.o

apmexists: apmexists.o

xapm: xapm.o $(LIBAPM)
	$(LT_LINK) -o $@ $< $(LDFLAGS) $(LIBAPM) $(XLDFLAGS) $(XLIBS)

$(LIBAPM): apmlib.lo
	$(LT_LINK) -o $@ $< $(LIBAPM_FLAGS) $(LDFLAGS)

apmlib.lo: apmlib.c apm.h
	$(LT_COMPILE) -c $(CPPFLAGS) $(CFLAGS) $(XTRACFLAGS) $<

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

install: $(EXES)
	[ -d $(DESTDIR)$(BINDIR)    ] || install -d $(DESTDIR)$(BINDIR)
	[ -d $(DESTDIR)$(SBINDIR)   ] || install -d $(DESTDIR)$(SBINDIR)
	[ -d $(DESTDIR)$(LIBDIR)    ] || install -d $(DESTDIR)$(LIBDIR)
	[ -d $(DESTDIR)$(INCDIR)    ] || install -d $(DESTDIR)$(INCDIR)
	$(LT_INSTALL) -m 644 $(LIBAPM)   $(DESTDIR)$(LIBDIR)
	$(LT_INSTALL)        apm         $(DESTDIR)$(BINDIR)
	$(LT_INSTALL)        apmd        $(DESTDIR)$(SBINDIR)
	$(LT_INSTALL)        xapm        $(DESTDIR)$(BINDIR)
	$(LT_INSTALL)        apmsleep    $(DESTDIR)$(BINDIR)
	install              on_ac_power $(DESTDIR)$(BINDIR)
	install       -m 644 apm.h       $(DESTDIR)$(INCDIR)

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