VERSION=0.0.11
CC=gcc
INCLUDES=-I ../../pslib/src
CFLAGS=-g -O0 -Wall -DMEMORY_DEBUGGING
PSLIB=../../pslib/src/.libs/libps.a
LIBS=-lm -lpng -ljpeg -lgif -ltiff
TARGETS=txt2ps einstein draw psclock hyperlinks hyphenate fontsample glyphlist ligatures ligexperts overprint spotcolor mmk memory pagehook shading image imagereuse showbox fontcreate logos schematic poster polish cmyk
PSDOCS=einstein.ps psclock.ps draw.ps hyperlinks.ps fontsample.ps glyphlist.ps ligatures.ps ligexperts.ps overprint.ps spotcolor.ps mmk.ps pagehook.ps shading.ps image.ps imagereuse.ps showbox.ps fontcreate.ps logos.ps schematic.ps poster.ps polish.ps cmyk.ps
DISTNAME=pslib-examples-$(VERSION)
all: $(TARGETS)
rebuild: clean all
help:
@echo "Available targets:"
@echo " all - Build all examples"
@echo " run - Run all examples and create PostScript files"
@echo " clean - Remove object files and example programs"
@echo " distclean - Same as 'clean', also remove PostScript files"
@echo " dist - Create new distribution"
@echo " rebuild - force rebuild of all example programs"
@echo " help - this output"
.c.o:
@echo "Compiling $<"
@$(CC) $(CFLAGS) $(INCLUDES) -c $<
$(PSDOCS):
@echo "Running ./$(patsubst %.ps,%,$@)"
@./$(patsubst %.ps,%,$@)
draw: draw.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
txt2ps: txt2ps.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
einstein: einstein.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
psclock: psclock.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
hyperlinks: hyperlinks.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
hyphenate: hyphenate.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
fontsample: fontsample.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
glyphlist: glyphlist.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
ligatures: ligatures.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
ligexperts: ligexperts.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
overprint: overprint.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
spotcolor: spotcolor.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
mmk: mmk.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
memory: memory.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
pagehook: pagehook.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
shading: shading.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
image: image.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
imagereuse: imagereuse.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
showbox: showbox.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
fontcreate: fontcreate.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
logos: logos.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
schematic: schematic.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
poster: poster.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
polish: polish.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
cmyk: cmyk.o
@echo "Building $@"
@$(CC) $< $(PSLIB) ${LIBS} -o $@
run: $(TARGETS)
@for i in $(TARGETS); do \
echo "Running $$i ..." ;\
eval ./$$i ;\
done
dist:
rm -rf $(DISTNAME)
mkdir $(DISTNAME)
cp README $(DISTNAME)
cp ChangeLog $(DISTNAME)
cp $(TARGETS:=.c) $(DISTNAME)
cp Makefile.unix $(DISTNAME)
cp CMakeLists.txt $(DISTNAME)
cp AlteSchwabacher.* $(DISTNAME)
cp cork.enc $(DISTNAME)
cp Helvetica.afm Helvetica.pro Courier.afm $(DISTNAME)
cp hyph_de.dic hyph_en.dic $(DISTNAME)
cp picture.eps debian.png debian.gif debian.tiff interlaced.gif $(DISTNAME)
cp indexed-alpha.png indexed.png rgb-alpha.png rgb.png $(DISTNAME)
cp exiftest.jpg debian.bmp gnu-head.jpg cne-cmyk.jpg debian-transparent.gif $(DISTNAME)
cp einstein.txt $(DISTNAME)
cp dice.afm dice.pfb $(DISTNAME)
tar czvf $(DISTNAME).tar.gz $(DISTNAME)
rm -rf $(DISTNAME)
clean:
@rm -f *.o $(TARGETS)
distclean: clean
@rm -f $(PSDOCS)
.PHONY : clean distclean dist rebuild