epsonsimplecups/Makefile
2024-09-17 15:56:49 +02:00

78 lines
1.9 KiB
Makefile

VPATH = src:ppd:bin
ppds = EpsonTMT20Simple.ppd.gz
DEFS=
LIBS=-lcupsimage -lcups
ifdef RPMBUILD
DEFS=-DRPMBUILD
LIBS=-ldl
endif
all: rastertoepsonsimple $(ppds)
.PHONY: all
bin:
mkdir -p bin
install/setup: rastertoepsonsimple $(ppds) setup
# packaging
@if [ -e install ]; then rm -f install/*; rmdir install; fi
mkdir install
cp bin/rastertoepsonsimple install
cp bin/*.ppd.gz install
cp bin/setup install
.PHONY: install
install:
@if [ ! -e install ]; then echo "Please run make package first."; exit 1; fi
# installing
cd install; exec ./setup
.PHONY: remove
remove:
#removing from default location (other locations require manual removal)
rm -f /usr/lib/cups/filter/rastertoepsonsimple
rm -rf /usr/share/cups/model/star
.PHONY: rpmbuild
rpmbuild:
@if [ ! -e install ]; then echo "Please run make package first."; exit 1; fi
# installing
RPMBUILD="true"; export RPMBUILD; cd install; exec ./setup
.PHONY: help
help:
# Help for starcupsdrv make file usage
#
# command purpose
# ------------------------------------
# make compile all sources and create the install directory
# make install execute the setup shell script from the install directory [require root user permissions]
# make remove removes installed files from your system (assumes default install lication) [requires root user permissions]
# make clean deletes all compiles files and their folders
%.o: %.c
gcc -Wall -fPIC -O2 $(DEFS) -c -o $@ $^
rastertoepsonsimple: rastertoepsonsimple.o bufferedscanlines.o
# compiling rastertoepsonsimple filter
ld $(NIX_LDFLAGS) $(DEFS) -o $@ $^ -lc $(LIBS)
#gcc $(DEFS) -o $@ $< $(LIBS)
$(ppds): %.ppd.gz: %.ppd
# gzip ppd file
gzip -c $< >> bin/$@
setup: setup.sh
$(dependencies)
$(init)
# create setup shell script
cp src/setup.sh bin/setup
chmod +x bin/setup
.PHONY: clean
clean:
rm -f *.o bin/* install/* rastertoepsonsimple