# Project:	lj2ps, LaserJet PCL to PostScript translator
# File:		Makefile
#
# Author:	Christopher Lishka
# Organization:	Wisconsin State Laboratory of Hygiene
#		Data Processing Department
#
# Note: I use "cake" instead of "make" to build the lj2ps program from its
# source files.  However, because cake isn't as popular as make, I
# have included this Makefile in the general distribution.  Anyone who
# would like the Recipe file for cake can contact me.  However, it is
# heavily dependent on my working style, and may not suit everyone's
# tastes.  - Chris 
#
# Possible CFLAGS options:
#
# -DDEBUG		Compile in diagnostic print code 
# -DVERBOSE_WARNINGS	More types of warnings are printed

PROGRAM	      = lj2ps

CFLAGS        = -O

LDFLAGS	      = -O

LIBS	      = -lm

LINKER	      = cc

# ----------------------------------------------------------------------

DEST	      = .

EXTHDRS	      = /usr/include/ctype.h \
		/usr/include/math.h \
		/usr/include/stdio.h \
		/usr/include/strings.h

HDRS	      = errors.h \
		lj.h \
		lj2ps.h \
		ljcmds.h \
		ljfonts.h \
		scan.h \
		trans.h

OBJS	      = errors.o \
		lj.o \
		lj2ps.o \
		ljcmds.o \
		ljfonts.o \
		scan.o \
		trans.o

SRCS	      = errors.c \
		lj.c \
		lj2ps.c \
		ljcmds.c \
		ljfonts.c \
		scan.c \
		trans.c

MAKEFILE      = Makefile

PRINT	      = pr

# ----------------------------------------------------------------------

all:		$(PROGRAM)

$(PROGRAM):     $(OBJS)
		@echo -n "Loading $(PROGRAM) ... "
		@$(LINKER) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)
		@echo "done"

clean:;		@rm -f $(OBJS)

depend:;	@mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DEST=$(DEST)

index:;		@ctags -wx $(HDRS) $(SRCS)

install:	$(PROGRAM)
		@echo Installing $(PROGRAM) in $(DEST)
		@install -s $(PROGRAM) $(DEST)

print:;		@$(PRINT) $(HDRS) $(SRCS)

program:        $(PROGRAM)

tags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)

update:		$(DEST)/$(PROGRAM)

$(DEST)/$(PROGRAM): $(SRCS) $(LIBS) $(HDRS) $(EXTHDRS)
		@make -f $(MAKEFILE) DEST=$(DEST) install
###
errors.o: /usr/include/stdio.h errors.h lj2ps.h lj.h
lj.o: /usr/include/stdio.h lj.h ljcmds.h ljfonts.h scan.h lj2ps.h
lj2ps.o: /usr/include/stdio.h /usr/include/math.h lj2ps.h lj.h trans.h \
	errors.h
ljcmds.o: /usr/include/stdio.h /usr/include/math.h ljcmds.h lj.h ljfonts.h \
	scan.h lj2ps.h
ljfonts.o: /usr/include/strings.h ljfonts.h lj.h
scan.o: /usr/include/stdio.h /usr/include/ctype.h scan.h lj.h lj2ps.h
trans.o: /usr/include/stdio.h trans.h scan.h lj2ps.h lj.h
