File: Makefile

package info (click to toggle)
brightd 0.4.1-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 212 kB
  • sloc: ansic: 1,827; makefile: 91
file content (39 lines) | stat: -rw-r--r-- 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
INSTALL ?= install
PREFIX=$(DESTDIR)/usr
BINDIR=bin/
#NO_X11=1  # (Uncomment this to disable X11 Support)

PACKAGE_VERSION=`awk '/RELEASE/ {print $$3}' brightd.c | tr -d \" | head -n1`

CFLAGS=-g -Wall -pedantic
MAN_NO_X11=1
ifndef NO_X11
MAN_NO_X11=0
A_CFLAGS=-lX11 -lXss -DX11
endif

all: brightd brightd.1

brightd: brightd.c
	$(CC) $@.c $(CFLAGS) $(A_CFLAGS) -o $@

brightd.1:
	sed -re 's/^\.nr no_x11 [01]/.nr no_x11 $(MAN_NO_X11)/' brightd.1.tpl > brightd.1

install:
	$(INSTALL) -Ds brightd $(PREFIX)/$(BINDIR)/brightd
	$(INSTALL) -D brightd.1 $(PREFIX)/share/man/man1/brightd.1

uninstall:
	rm $(PREFIX)/$(BINDIR)/brightd
	rm $(PREFIX)/share/man/man1/brightd.1

clean:
	rm -f brightd brightd.1

# Source tarball generation
source:
	mkdir brightd-$(PACKAGE_VERSION)/
	cp brightd.{1.tpl,c} ChangeLog gpl.txt Makefile README brightd-$(PACKAGE_VERSION)/
	tar cjf brightd-$(PACKAGE_VERSION).tar.bz2 brightd-$(PACKAGE_VERSION)/
	rm -rf brightd-$(PACKAGE_VERSION)/