forked from OpenPrinting/ps-printer-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (51 loc) · 1.48 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#
# Makefile for the PostScript Printer Application
#
# Copyright © 2020 by Till Kamppeter
# Copyright © 2020 by Michael R Sweet
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#
# Version and
VERSION = 1.0
prefix = $(DESTDIR)/usr
includedir = $(prefix)/include
bindir = $(prefix)/bin
libdir = $(prefix)/lib
mandir = $(prefix)/share/man
ppddir = $(prefix)/share/ppd
resourcedir = $(prefix)/share/ps-printer-app
unitdir := `pkg-config --variable=systemdsystemunitdir systemd`
# Compiler/linker options...
OPTIM = -Os -g
CFLAGS += `pkg-config --cflags pappl` `cups-config --cflags` `pkg-config --cflags libppd` `pkg-config --cflags libcupsfilters` $(OPTIM)
LDFLAGS += $(OPTIM) `cups-config --ldflags`
LIBS += `pkg-config --libs pappl` `cups-config --image --libs` `pkg-config --libs libppd` `pkg-config --libs libcupsfilters`
# Targets...
OBJS = ps-printer-app.o
TARGETS = ps-printer-app
# General build rules...
.SUFFIXES: .c .o
.c.o:
$(CC) $(CFLAGS) -c -o $@ $<
# Targets...
all: $(TARGETS)
clean:
rm -f $(TARGETS) $(OBJS)
install: $(TARGETS)
mkdir -p $(bindir)
cp $(TARGETS) $(bindir)
mkdir -p $(mandir)/man1
cp ps-printer-app.1 $(mandir)/man1
mkdir -p $(ppddir)
cp generic-ps-printer.ppd $(ppddir)
mkdir -p $(resourcedir)
cp testpage.ps $(resourcedir)
if test "x$(unitdir)" != x; then \
mkdir -p $(unitdir); \
cp ps-printer-app.service $(unitdir); \
fi
ps-printer-app: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
$(OBJS): Makefile