forked from joelburget/slimlock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (39 loc) · 1.31 KB
/
Makefile
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
# slimlock makefile
# © 2010-2012 Joel Burget
CXX = g++
CC = gcc
PKGS=x11 xrandr xft fontconfig imlib2 xext
MYCFLAGS=-Wall -I. $(shell pkg-config --cflags $(PKGS)) -pthread
CXXFLAGS=$(CFLAGS) $(MYCFLAGS)
LIBS=$(shell pkg-config --libs $(PKGS)) -lrt -lpam -pthread
CUSTOM=
NAME=slimlock
VERSION=0.11
CFGDIR=/etc
MANDIR=/usr/share/man
DESTDIR=
PREFIX=/usr
DEFINES=-DPACKAGE=\"$(NAME)\" -DVERSION=\"$(VERSION)\" \
-DPKGDATADIR=\"$(PREFIX)/share/slim\" -DSYSCONFDIR=\"$(CFGDIR)\"
OBJECTS=cfg.o image.o panel.o slimlock.o util.o
all: slimlock
slimlock: $(OBJECTS)
$(CXX) $(LDFLAGS) $(OBJECTS) -o $(NAME) $(LIBS)
.cpp.o:
$(CXX) $(CXXFLAGS) $(DEFINES) $(CUSTOM) -c $< -o $@
.c.o:
$(CC) $(CFLAGS) $(MYCFLAGS) $(DEFINES) $(CUSTOM) -c $< -o $@
clean:
@rm -f slimlock *.o
dist:
@rm -rf $(NAME)-$(VERSION)
@mkdir $(NAME)-$(VERSION)
@cp -r *.cpp *.h *.c Makefile LICENSE README.md slimlock.1 slimlock.conf $(NAME)-$(VERSION)
@tar cvzf $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION)
@rm -rf $(NAME)-$(VERSION)
install: slimlock
@install -D -m 644 slimlock.1 $(DESTDIR)$(MANDIR)/man1/slimlock.1
@install -D -m 755 slimlock $(DESTDIR)$(PREFIX)/bin/slimlock
@chmod u+s $(DESTDIR)$(PREFIX)/bin/slimlock
@install -D -m 644 slimlock.conf $(DESTDIR)$(CFGDIR)/slimlock.conf
@install -D -m 644 slimlock.pam $(DESTDIR)$(CFGDIR)/pam.d/slimlock