# Makefile for jpeg2ps
# (C) Thomas Merz 1994-1997

# ----------------------------------------------------------------------------
# UNIX version
# throw out -DA4 if you want letter format as default size
# use -DKNR for Kernighan/Ritchie compilers

CC=gcc
# CCOPT= -c -DA4 -s -Wall
CCOPT= -c -s -Wall
LD=gcc
LDOPT= -s
OBJ=o
EXE=.exe
RM=rm

.c.$(OBJ) :
	$(CC) $(CCOPT) $*.c

all:	jpeg2ps$(EXE)

jpeg2ps$(EXE):	jpeg2ps.$(OBJ) readjpeg.$(OBJ) asc85ec.$(OBJ) getopt.$(OBJ)
		$(LD) $(LDOPT) -o jpeg2ps$(EXE) jpeg2ps.$(OBJ) readjpeg.$(OBJ) asc85ec.$(OBJ) getopt.$(OBJ)


zip:	jpeg2ps.c psimage.h readjpeg.c asc85ec.c getopt.c makefile.dos makefile.unx jpeg2ps.txt jpeg2ps.exe
	lineend -d *.c *.h makefile.* *.txt
	pkzip jpeg2ps.zip *.c *.h *.txt makefile.* jpeg2ps.exe

os2dist: 
	zip -u -m -9 jpeg2ps2.zip jpeg2ps.c psimage.h readjpeg.c asc85ec.c getopt.c makefile.dos makefile.org makefile.os2 makefile.unx jpeg2ps.txt jpeg2ps.exe readme.os2
	zip -u -9 jpeg2ps2.zip makefile

tar:	jpeg2ps.c psimage.h readjpeg.c asc85ec.c getopt.c makefile.dos makefile jpeg2ps.txt
	lineend -u *.c *.h makefile *.txt
	tar cvf jpeg2ps.tar *.c *.h *.txt makefile makefile.dos makefile.org makefile.os2
	gzip -9 jpeg2ps.tar

clean:
	-$(RM) *.$(OBJ)

veryclean: clean
	-$(RM) jpeg2ps$(EXE)
	-$(RM) *~

jpeg2ps.$(OBJ):		jpeg2ps.c psimage.h

readjpeg.$(OBJ):	readjpeg.c psimage.h

asc85ec.$(OBJ):		asc85ec.c

getopt.$(OBJ):		getopt.c
