clean up Makefile, move files to top-dir.

This commit is contained in:
Denis Knauf 2024-09-17 15:56:49 +02:00
parent 486a669d1e
commit ce6eac07d8
6 changed files with 16 additions and 232 deletions

3
.gitignore vendored
View file

@ -1 +1,4 @@
*.swp *.swp
*.o
/bin
/rastertoepsonsimple

View file

@ -10,18 +10,11 @@ DEFS=-DRPMBUILD
LIBS=-ldl LIBS=-ldl
endif endif
define dependencies all: rastertoepsonsimple $(ppds)
@if [ ! -e /usr/include/cups ]; then echo "CUPS headers not available - exiting"; exit 1; fi .PHONY: all
endef
define init bin:
@if [ ! -e bin ]; then echo "mkdir bin"; mkdir bin; fi mkdir -p bin
endef
define sweep
@if [ -e bin ]; then echo "rm -f bin/*"; rm -f bin/*; rmdir bin; fi
@if [ -e install ]; then echo "rm -f install/*"; rm -f install/*; rmdir install; fi
endef
install/setup: rastertoepsonsimple $(ppds) setup install/setup: rastertoepsonsimple $(ppds) setup
# packaging # packaging
@ -40,8 +33,8 @@ install:
.PHONY: remove .PHONY: remove
remove: remove:
#removing from default location (other locations require manual removal) #removing from default location (other locations require manual removal)
@if [ -e /usr/lib/cups/filter/rastertoepsonsimple ]; then echo "Removing rastertoepsonsimple"; rm -f /usr/lib/cups/filter/rastertoepsonsimple; fi rm -f /usr/lib/cups/filter/rastertoepsonsimple
@if [ -d /usr/share/cups/model/star ]; then echo "Removing dir .../cups/model/star"; rm -rf /usr/share/cups/model/star; fi rm -rf /usr/share/cups/model/star
.PHONY: rpmbuild .PHONY: rpmbuild
rpmbuild: rpmbuild:
@ -60,12 +53,13 @@ help:
# make remove removes installed files from your system (assumes default install lication) [requires 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 # make clean deletes all compiles files and their folders
rastertoepsonsimple: rastertoepsonsimple.c bufferedscanlines.o %.o: %.c
$(dependencies) gcc -Wall -fPIC -O2 $(DEFS) -c -o $@ $^
$(init)
# compiling rastertoepsonsimple filter
gcc -Wl,-rpath,/usr/lib -Wall -fPIC -O2 $(DEFS) -o bin/rastertoepsonsimple bufferedscanlines.o src/rastertoepsonsimple.c $(LIBS)
rastertoepsonsimple: rastertoepsonsimple.o bufferedscanlines.o
# compiling rastertoepsonsimple filter
ld $(NIX_LDFLAGS) $(DEFS) -o $@ $^ -lc $(LIBS)
#gcc $(DEFS) -o $@ $< $(LIBS)
$(ppds): %.ppd.gz: %.ppd $(ppds): %.ppd.gz: %.ppd
# gzip ppd file # gzip ppd file
@ -80,6 +74,4 @@ setup: setup.sh
.PHONY: clean .PHONY: clean
clean: clean:
# cleaning rm -f *.o bin/* install/* rastertoepsonsimple
$(sweep)

View file

@ -1,211 +0,0 @@
*PPD-Adobe: "4.3"
*FormatVersion: "4.3"
*FileVersion: "2.0"
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "EpsonTMT20Simple.ppd"
*Manufacturer: "Epson"
*Product: "(TM-T20)"
*1284DeviceID: "MFG:Epson;CMD:Epson;MDL:TMT20;CLS:PRINTER;"
*cupsVersion: 1.1
*cupsManualCopies: True
*cupsModelNumber: 20
*cupsFilter: "application/vnd.cups-raster 0 rastertoepsonsimple"
*ModelName: "TM-T20"
*ShortNickName: "TM-T20"
*NickName: "Epson TM-T20"
*PSVersion: "(3010.000) 550"
*LanguageLevel: "3"
*ColorDevice: False
*DefaultColorSpace: Gray
*FileSystem: False
*Throughput: "1"
*LandscapeOrientation: Plus90
*VariablePaperSize: True
*TTRasterizer: Type42
*cupsSNMPSupplies: False
*cupsIPPReason com.star-paper_out_error/Printer is out of paper: ""
*OpenUI *PageSize/Media Size: PickOne
*OrderDependency: 10 AnySetup *PageSize
*DefaultPageSize: X80MMY200MM
*%PageSize Custom/Custom: "<</PageSize[0 0]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*% 50.8mm wide page size note
*% 50.8mm = 2.0in * 72 = 144 points
*% use 143 points to cause 5.0 point difference with 52.5mm paper and help CUPS matching algorithm
*% see CUPS src - gdevcups.c - search "find matching page size"
*PageSize X80MMY30MM/80mm * 30mm: "<</PageSize[226 85]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY40MM/80mm * 40mm: "<</PageSize[226 113]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY50MM/80mm * 50mm: "<</PageSize[226 141]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY60MM/80mm * 60mm: "<</PageSize[226 170]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY70MM/80mm * 70mm: "<</PageSize[226 198]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY80MM/80mm * 80mm: "<</PageSize[226 226]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY90MM/80mm * 90mm: "<</PageSize[226 255]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY100MM/80mm * 100mm: "<</PageSize[226 283]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY110MM/80mm * 110mm: "<</PageSize[226 311]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY120MM/80mm * 120mm: "<</PageSize[226 340]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY130MM/80mm * 130mm: "<</PageSize[226 368]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY140MM/80mm * 140mm: "<</PageSize[226 396]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY150MM/80mm * 150mm: "<</PageSize[226 425]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY160MM/80mm * 160mm: "<</PageSize[226 453]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY170MM/80mm * 170mm: "<</PageSize[226 481]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY180MM/80mm * 180mm: "<</PageSize[226 510]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY190MM/80mm * 190mm: "<</PageSize[226 538]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY200MM/80mm * 200mm: "<</PageSize[226 566]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY1500MM/80mm * 1500mm: "<</PageSize[226 4251]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageSize X80MMY2000MM/80mm * 2000mm: "<</PageSize[226 5668]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*% Zoom resolution calculation note
*% A4 real width = 209mm = 8.23in
*% Printer real width = 72mm = 576 dots
*% Printer real resolution = 203dpi
*% Rendering resolution = floor(576 dots / (8.23in * (1 - zoom)))
*% 69 = floor(576 / (8.23 * (1 - 0)))
*% 139 = floor(576 / (8.23 * (1 - .5)))
*PageSize A4/A4 : "<</PageSize[595 842]/HWResolution[69 69]/ImagingBBox null>>setpagedevice"
*PageSize Letter/Letter : "<</PageSize[612 792]/HWResolution[67 67]/ImagingBBox null>>setpagedevice"
*PageSize Legal/Legal : "<</PageSize[612 1008]/HWResolution[67 67]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageSize
*OpenUI *PageRegion: PickOne
*OrderDependency: 10 AnySetup *PageRegion
*DefaultPageRegion: X80MMY200MM
*%PageRegion Custom/Custom: "<</PageSize[0 0]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY30MM/80mm * 30mm: "<</PageSize[226 85]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY40MM/80mm * 40mm: "<</PageSize[226 113]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY50MM/80mm * 50mm: "<</PageSize[226 141]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY60MM/80mm * 60mm: "<</PageSize[226 170]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY70MM/80mm * 70mm: "<</PageSize[226 198]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY80MM/80mm * 80mm: "<</PageSize[226 226]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY90MM/80mm * 90mm: "<</PageSize[226 255]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY100MM/80mm * 100mm: "<</PageSize[226 283]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY110MM/80mm * 110mm: "<</PageSize[226 311]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY120MM/80mm * 120mm: "<</PageSize[226 340]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY130MM/80mm * 130mm: "<</PageSize[226 368]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY140MM/80mm * 140mm: "<</PageSize[226 396]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY150MM/80mm * 150mm: "<</PageSize[226 425]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY160MM/80mm * 160mm: "<</PageSize[226 453]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY170MM/80mm * 170mm: "<</PageSize[226 481]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY180MM/80mm * 180mm: "<</PageSize[226 510]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY190MM/80mm * 190mm: "<</PageSize[226 538]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY200MM/80mm * 200mm: "<</PageSize[226 566]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY1500MM/80mm * 1500mm: "<</PageSize[226 4251]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion X80MMY2000MM/80mm * 2000mm: "<</PageSize[226 5668]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*PageRegion A4/A4 : "<</PageSize[595 842]/HWResolution[69 69]/ImagingBBox null>>setpagedevice"
*PageRegion Letter/Letter : "<</PageSize[612 792]/HWResolution[67 67]/ImagingBBox null>>setpagedevice"
*PageRegion Legal/Legal : "<</PageSize[612 1008]/HWResolution[67 67]/ImagingBBox null>>setpagedevice"
*CloseUI: *PageRegion
*DefaultImageableArea: X80MMY200MM
*%ImageableArea Custom: "0.0 0.0 0.0 0.0"
*ImageableArea X80MMY30MM: "0.0 0.0 226.0 85.0"
*ImageableArea X80MMY40MM: "0.0 0.0 226.0 113.0"
*ImageableArea X80MMY50MM: "0.0 0.0 226.0 141.0"
*ImageableArea X80MMY60MM: "0.0 0.0 226.0 170.0"
*ImageableArea X80MMY70MM: "0.0 0.0 226.0 198.0"
*ImageableArea X80MMY80MM: "0.0 0.0 226.0 226.0"
*ImageableArea X80MMY90MM: "0.0 0.0 226.0 255.0"
*ImageableArea X80MMY100MM: "0.0 0.0 226.0 283.0"
*ImageableArea X80MMY110MM: "0.0 0.0 226.0 311.0"
*ImageableArea X80MMY120MM: "0.0 0.0 226.0 340.0"
*ImageableArea X80MMY130MM: "0.0 0.0 226.0 368.0"
*ImageableArea X80MMY140MM: "0.0 0.0 226.0 396.0"
*ImageableArea X80MMY150MM: "0.0 0.0 226.0 425.0"
*ImageableArea X80MMY160MM: "0.0 0.0 226.0 453.0"
*ImageableArea X80MMY170MM: "0.0 0.0 226.0 481.0"
*ImageableArea X80MMY180MM: "0.0 0.0 226.0 510.0"
*ImageableArea X80MMY190MM: "0.0 0.0 226.0 538.0"
*ImageableArea X80MMY200MM: "0.0 0.0 226.0 566.0"
*ImageableArea X80MMY1500MM: "0.0 0.0 226.0 4251.0"
*ImageableArea X80MMY2000MM: "0.0 0.0 226.0 5668.0"
*ImageableArea A4: "0.0 0.0 595.0 842.0"
*ImageableArea Letter: "0.0 0.0 612.0 792.0"
*ImageableArea Legal: "0.0 0.0 612.0 1008.0"
*DefaultPaperDimension: X80MMY200MM
*%PaperDimension Custom: "0 0"
*PaperDimension X80MMY30MM: "226 85"
*PaperDimension X80MMY40MM: "226 113"
*PaperDimension X80MMY50MM: "226 141"
*PaperDimension X80MMY60MM: "226 170"
*PaperDimension X80MMY70MM: "226 198"
*PaperDimension X80MMY80MM: "226 226"
*PaperDimension X80MMY90MM: "226 255"
*PaperDimension X80MMY100MM: "226 283"
*PaperDimension X80MMY110MM: "226 311"
*PaperDimension X80MMY120MM: "226 340"
*PaperDimension X80MMY130MM: "226 368"
*PaperDimension X80MMY140MM: "226 396"
*PaperDimension X80MMY150MM: "226 425"
*PaperDimension X80MMY160MM: "226 453"
*PaperDimension X80MMY170MM: "226 481"
*PaperDimension X80MMY180MM: "226 510"
*PaperDimension X80MMY190MM: "226 538"
*PaperDimension X80MMY200MM: "226 566"
*PaperDimension X80MMY1500MM: "226 4251"
*PaperDimension X80MMY2000MM: "226 5668"
*PaperDimension A4: "595 842"
*PaperDimension Letter: "612 792"
*PaperDimension Legal: "612 1008"
*MaxMediaWidth: "226"
*MaxMediaHeight: "5670"
*HWMargins: 0 0 0 0
*CustomPageSize True: "pop pop pop <</PageSize[5 -2 roll]/HWResolution[203 203]/ImagingBBox null>>setpagedevice"
*ParamCustomPageSize Width: 1 points 72 226
*ParamCustomPageSize Height: 2 points 72 5670
*ParamCustomPageSize WidthOffset: 3 points 0 0
*ParamCustomPageSize HeightOffset: 4 points 0 0
*ParamCustomPageSize Orientation: 5 int 0 0
*OpenGroup: OutputGroup/Output Options
*OpenUI *PageType/3. Page Type: PickOne
*DefaultPageType: 0Variable
*PageType 0Variable/Variable Length: ""
*PageType 1Fixed/Fixed Length: ""
*CloseUI: *PageType
*OpenUI *PixelDoublingType/4. Pixel Doubling: PickOne
*DefaultPixelDoublingType: 0NoDoubling
*PixelDoublingType 0NoDoubling/None: ""
*PixelDoublingType 1HorizontalDoubling/Double Width: ""
*PixelDoublingType 2VerticalDoubling/Double High: ""
*PixelDoublingType 3BothDoubling/Double Wide and High: ""
*CloseUI: *PixelDoublingType
*CloseGroup: OutputGroup
*OpenGroup: CutGroup/Cut Options
*OpenUI *PageCutType/1. Page Cut Type: PickOne
*DefaultPageCutType: 0NoCutPage
*PageCutType 0NoCutPage/No Cut: ""
*PageCutType 1CutPage/Cut: ""
*CloseUI: *PageCutType
*OpenUI *DocCutType/2. Document Cut Type: PickOne
*DefaultDocCutType: 1CutDoc
*DocCutType 0NoCutDoc/No Cut: ""
*DocCutType 1CutDoc/Cut: ""
*CloseUI: *DocCutType
*CloseGroup: CutGroup
*OpenGroup: DoublingGroup/Pixel Doubling
*CloseGroup: DoublingGroup
*% End