2015-07-24 23:37:12 -04:00
|
|
|
# Basic stuff
|
|
|
|
BACKEND_NAME ?= gutenprint52+usb
|
|
|
|
EXEC_NAME ?= dyesub_backend
|
|
|
|
|
2016-04-16 09:02:09 -04:00
|
|
|
# Destination directories (rely on CUPS to tell us where)
|
|
|
|
PREFIX ?=
|
|
|
|
CUPS_BACKEND_DIR ?= $(PREFIX)`cups-config --serverbin`/backend
|
|
|
|
CUPS_DATA_DIR ?= $(PREFIX)`cups-config --datadir`
|
2015-07-24 23:37:12 -04:00
|
|
|
|
|
|
|
# Tools
|
2015-12-25 10:15:04 -05:00
|
|
|
CC ?= $(CROSS_COMPILE)gcc
|
|
|
|
CPPCHECK ?= cppcheck
|
|
|
|
MKDIR ?= mkdir
|
|
|
|
INSTALL ?= install
|
|
|
|
LN ?= ln
|
|
|
|
RM ?= rm
|
2015-07-24 23:37:12 -04:00
|
|
|
|
|
|
|
# Flags
|
2016-01-14 15:00:18 -05:00
|
|
|
CFLAGS += -Wall -Wextra -g -Os -D_GNU_SOURCE -std=c99 # -Wconversion
|
2016-01-31 18:17:25 -05:00
|
|
|
LDFLAGS += `pkg-config --libs libusb-1.0`
|
2015-07-24 23:37:12 -04:00
|
|
|
CPPFLAGS += `pkg-config --cflags libusb-1.0`
|
|
|
|
# CPPFLAGS += -DLIBUSB_PRE_1_0_10
|
|
|
|
CPPFLAGS += -DURI_PREFIX=\"$(BACKEND_NAME)\"
|
2013-07-18 08:46:44 -04:00
|
|
|
|
2015-07-24 23:37:12 -04:00
|
|
|
# List of backends
|
2015-07-26 23:05:21 -04:00
|
|
|
BACKENDS = sonyupdr150 kodak6800 kodak1400 shinkos2145 shinkos1245 canonselphy mitsu70x kodak605 dnpds40 citizencw01 mitsu9550 shinkos6245 shinkos6145
|
2013-07-06 10:14:06 -04:00
|
|
|
|
2016-01-31 18:17:25 -05:00
|
|
|
# For the s6145 backend
|
|
|
|
CPPFLAGS += -DUSE_DLOPEN
|
|
|
|
LDFLAGS += -ldl
|
|
|
|
#CPPFLAGS += -DUSE_LTDL
|
|
|
|
#LDFLAGS += -lltdl
|
|
|
|
|
2015-07-24 23:37:12 -04:00
|
|
|
# Build stuff
|
2015-12-25 10:15:04 -05:00
|
|
|
DEPS += backend_common.h
|
2013-11-16 17:33:13 -05:00
|
|
|
SOURCES = backend_common.c $(addsuffix .c,$(addprefix backend_,$(BACKENDS)))
|
2013-07-18 22:10:56 -04:00
|
|
|
|
2015-07-24 23:37:12 -04:00
|
|
|
# And now the rules!
|
2016-01-14 15:00:18 -05:00
|
|
|
.PHONY: clean all install cppcheck
|
|
|
|
|
2014-01-22 08:35:12 -05:00
|
|
|
all: $(EXEC_NAME) $(BACKENDS)
|
2013-07-18 22:10:56 -04:00
|
|
|
|
2014-01-22 08:35:12 -05:00
|
|
|
$(EXEC_NAME): $(SOURCES) $(DEPS)
|
2015-07-24 23:37:12 -04:00
|
|
|
$(CC) -o $@ $(SOURCES) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
2013-07-18 18:03:40 -04:00
|
|
|
|
2014-01-22 08:35:12 -05:00
|
|
|
$(BACKENDS): $(EXEC_NAME)
|
2015-07-24 23:37:12 -04:00
|
|
|
$(LN) -sf $(EXEC_NAME) $@
|
2013-10-05 09:55:29 -04:00
|
|
|
|
2014-02-11 13:41:15 -05:00
|
|
|
cppcheck:
|
2015-07-24 23:37:12 -04:00
|
|
|
$(CPPCHECK) -q -v --std=c99 --enable=all -I/usr/include $(CPPFLAGS) $(SOURCES)
|
2014-02-11 13:41:15 -05:00
|
|
|
|
2015-07-04 10:12:57 -04:00
|
|
|
install:
|
2015-07-24 23:37:12 -04:00
|
|
|
$(MKDIR) -p $(CUPS_BACKEND_DIR)
|
|
|
|
$(INSTALL) -o root -m 700 $(EXEC_NAME) $(CUPS_BACKEND_DIR)/$(BACKEND_NAME)
|
|
|
|
$(MKDIR) -p $(CUPS_DATA_DIR)/usb
|
|
|
|
$(INSTALL) -o root -m 644 blacklist $(CUPS_DATA_DIR)/usb/net.sf.gimp-print.usb-quirks
|
2012-11-13 16:32:53 -05:00
|
|
|
|
|
|
|
clean:
|
2015-07-24 23:37:12 -04:00
|
|
|
$(RM) -f $(EXEC_NAME) $(BACKENDS)
|
2016-01-18 21:16:50 -05:00
|
|
|
|
|
|
|
release:
|
|
|
|
$(RM) -Rf selphy_print-rel
|
|
|
|
$(MKDIR) -p selphy_print-rel
|
2016-02-01 17:11:42 -05:00
|
|
|
cp -a *.c *.h Makefile blacklist COPYING README lib6145 D70 selphy_print-rel
|
|
|
|
tar -czvf selphy_print-rel.tar.gz selphy_print-rel
|
2016-01-18 21:16:50 -05:00
|
|
|
$(RM) -Rf selphy_print-rel
|