File: Makefile

package info (click to toggle)
sleepd 1.11
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 148 kB
  • ctags: 116
  • sloc: ansic: 985; makefile: 67; sh: 52
file content (42 lines) | stat: -rw-r--r-- 1,030 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
CFLAGS		= -O2 -Wall -DACPI_APM
BINS		= sleepd sleepctl
PREFIX		= /
INSTALL_PROGRAM	= install
USE_HAL		= 1

# DEB_BUILD_OPTIONS suport, to control binary stripping.
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif

# And debug building.
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
endif

OBJS=sleepd.o acpi.o
LIBS=-lapm

all: $(BINS)

ifdef USE_HAL
LIBS+=$(shell pkg-config --libs hal)
OBJS+=simplehal.o
CFLAGS+=-DHAL
simplehal.o: simplehal.c
	$(CC) $(CFLAGS) $(shell pkg-config --cflags hal) -c simplehal.c -o simplehal.o
endif

sleepd: $(OBJS)
	$(CC) $(CFLAGS) -o sleepd $(OBJS) $(LIBS)

clean:
	rm -f $(BINS) *.o

install: $(BINS)
	install -d $(PREFIX)/usr/sbin/ $(PREFIX)/usr/share/man/man8/ \
		$(PREFIX)/usr/bin/ $(PREFIX)/usr/share/man/man1/
	$(INSTALL_PROGRAM) sleepd $(PREFIX)/usr/sbin/
	install -m 0644 sleepd.8 $(PREFIX)/usr/share/man/man8/
	$(INSTALL_PROGRAM) -m 4755 -o root -g root sleepctl $(PREFIX)/usr/bin/
	install -m 0644 sleepctl.1 $(PREFIX)/usr/share/man/man1/