#---------------------------------------------------------------
#	Make file for pf
#---------------------------------------------------------------

DATE:=$(shell date +%y%m%d)
CC		= gcc
LIBS	=	-L./i18n-char -li18n
SUBDIRS	= i18n-char

OPTFLAG	=	-O
CCFLAG	=	-funsigned-char -Wall
INCLUDE	=	-I . -I ./i18n-char
DEBUG	=
#DEBUG	= -DDEBUG -DTRACE

CFLAGS	=	$(OPTFLAG) $(CCFLAG) $(DEBUG) $(OTHER) $(INCLUDE) $(DEFINES)

TARGET	= pf

%.o	: %.c
	$(CC) $(CFLAGS)  -c $<

SRCS	= pf.c driver.c printer.c prtdef.c
DRIVER	= ESCP.c FMPR.c PCPR.c PS.c text.c
OBJS	= $(SRCS:.c=.o) $(DRIVER:.c=.o)
HEADER	= pf.h debug.h $(DRIVER:.c=.h)

all	:	suball $(TARGET)

clean: subclean
	rm -f *.o pf *~ .depend

dep: subdep
	$(CC) -MM $(CFLAGS) $(SRCS) > .depend
	$(CC) -MM $(CFLAGS) $(DRIVER) >> .depend

pf	: $(OBJS)
	$(CC) $(OBJS) $(LIBS) -o pf

#ifeq (.depend,$(wildcard .depend))
#include .depend
#endif


suball:
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i all; done
subdep:
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i dep; done
subclean:
	set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
