-
Notifications
You must be signed in to change notification settings - Fork 5
/
module.mk
79 lines (66 loc) · 2.09 KB
/
module.mk
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
#
# module.mk (C) 2007-2008, Aurélien Croc (AP²C)
#
# Compilation file for SpliX
#
# Options: DISABLE_JBIG
# DISABLE_THREADS
# DISABLE_BLACKOPTIM
# Compilation option:
# V=1 Verbose mode
# DESTDIR=xxx Change the destination directory prefix
# DRV_ONLY Don't install PPD files at all, only DRV files.
MODE := optimized
SUBDIRS += src
TARGETS := rastertoqpdl pstoqpdl
PRE_GENERIC_TARGETS := optionList
# Default options
THREADS ?= 2
CACHESIZE ?= 30
DISABLE_JBIG ?= 0
DISABLE_THREADS ?= 0
DISABLE_BLACKOPTIM ?= 0
DRV_ONLY ?= 0
# Flags
CXXFLAGS += `pkg-config --cflags cups` -Iinclude -Wall -I/opt/local/include
DEBUG_CXXFLAGS += -DDEBUG -DDUMP_CACHE
OPTIM_CXXFLAGS += -g
rastertoqpdl_LDFLAGS := $(LDFLAGS) -L/opt/local/lib
rastertoqpdl_LIBS := `pkg-config --libs cups` -lcupsimage
pstoqpdl_LDFLAGS := $(LDFLAGS)
pstoqpdl_LIBS := `pkg-config --libs cups` -lcupsimage
# Update compilation flags with defined options
ifneq ($(DISABLE_THREADS),0)
CXXFLAGS += -DDISABLE_THREADS
else
CXXFLAGS += -DTHREADS=$(THREADS) -DCACHESIZE=$(CACHESIZE)
rastertoqpdl_LIBS += -lpthread
pstoqpdl_LIBS += -lpthread
endif
ifneq ($(DISABLE_JBIG),0)
CXXFLAGS += -DDISABLE_JBIG
else
rastertoqpdl_LIBS += -ljbig85
endif
ifneq ($(DISABLE_BLACKOPTIM),0)
CXXFLAGS += -DDISABLE_BLACKOPTIM
endif
# Get some information
CUPSFILTER := `pkg-config --variable=cups_serverbin cups`/filter
CUPSPPD ?= `pkg-config --variable=cups_datadir cups`/model
CUPSDRV ?= `pkg-config --variable=cups_datadir cups`/drv
ifeq ($(ARCHI),Darwin)
PSTORASTER := pstocupsraster
else
PSTORASTER := pstoraster
endif
GSTORASTER := gstoraster
CUPSPROFILE := `pkg-config --variable=cups_datadir`/profiles
export CUPSFILTER CUPSPPD CUPSDRV
# Specific information needed by pstoqpdl
src_pstoqpdl_cpp_FLAGS := -DRASTERDIR=\"$(CUPSFILTER)\"
src_pstoqpdl_cpp_FLAGS += -DRASTERTOQPDL=\"rastertoqpdl\"
src_pstoqpdl_cpp_FLAGS += -DPSTORASTER=\"$(PSTORASTER)\"
src_pstoqpdl_cpp_FLAGS += -DGSTORASTER=\"$(GSTORASTER)\"
src_pstoqpdl_cpp_FLAGS += -DCUPSPPD=\"$(CUPSPPD)\"
src_pstoqpdl_cpp_FLAGS += -DCUPSPROFILE=\"$(CUPSPROFILE)\"