# Makefile for Mesh-Potato fxsinterface pdf files 
# Generates schematic PDF from gschem schematic files
# Derived from the BlackfinOne Makefile - thanks Ivan

SCH_FILES = fxsinterface01 fxsinterface02
PROJECT = mesh-potato-fxsinterface
REV     := $(shell svn info | grep Revision | sed 's/Revision: //')

SCHPS     = $(addsuffix .ps,$(SCH_FILES))
SCHPDF    = $(addsuffix .sch.ps,$(SCH_FILES))
PWD       = $(shell pwd)

PCB_PRINT_OPTIONS = --ps-color --media A4

all: schpdf 

# bom

%.ps: %.sch
	gschem -o $@ -s gschem-print.scm $^

schpdf: $(SCHPS)
	-rm *_sch.ps
	# sed stuff enlarges gschem font which is too small for my eyes :-)
	cat $(SCHPS) | sed 's/scalefont/1.3 mul scalefont/' > $(PROJECT)_sch.ps
	ps2pdf $(PROJECT)_sch.ps $(PROJECT)_sch.pdf

