-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.mk
80 lines (66 loc) · 1.91 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
79
#
# 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
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
# Flags
CXXFLAGS += `cups-config --cflags` -Iinclude -Wall -I/opt/local/include
DEBUG_CXXFLAGS += -DDEBUG -DDUMP_CACHE
OPTIM_CXXFLAGS += -g
rastertoqpdl_LDFLAGS := `cups-config --ldflags` -L/opt/local/lib
rastertoqpdl_LIBS := `cups-config --libs` -lcupsimage
pstoqpdl_LDFLAGS := `cups-config --ldflags`
pstoqpdl_LIBS := `cups-config --libs` -lcupsimage
ifeq ($(ARCHI),Darwin)
CXXFLAGS += -I`brew --prefix`/include
rastertoqpdl_LDFLAGS += -L`brew --prefix`/lib
pstoqpdl_LDFLAGS += -L`brew --prefix`/lib
endif
# Update compilation flags with defined options
ifneq ($(DISABLE_THREADS),0)
CXXFLAGS += -DDISABLE_THREADS
else
CXXFLAGS += -DTHREADS=$(THREADS) -DCACHESIZE=$(CACHESIZE)
endif
ifneq ($(DISABLE_JBIG),0)
CXXFLAGS += -DDISABLE_JBIG
else
rastertoqpdl_LIBS += -ljbig
endif
ifneq ($(DISABLE_BLACKOPTIM),0)
CXXFLAGS += -DDISABLE_BLACKOPTIM
endif
# Get some information
CUPSFILTER := `cups-config --serverbin`/filter
ifeq ($(ARCHI),Darwin)
CUPSPPD := /Library/Printers/PPDs/Contents/Resources
else
CUPSPPD := `cups-config --datadir`/model
endif
ifeq ($(ARCHI),Darwin)
PSTORASTER := pstocupsraster
else
PSTORASTER := pstoraster
endif
export CUPSFILTER CUPSPPD
# 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 += -DCUPSPPD=\"$(CUPSPPD)\"