# makefile.tcc.  Generated automatically from Makefile.in by configdos.
# Makefile for GNU recode.
# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
# Francois Pinard <pinard@iro.umontreal.ca>, 1988.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

PRODUCT = recode
VERSION = 3.4

srcdir = .
VPATH = .

# These CFLAGS values are not auto-configured:
# -DDIFF_HASH		For using GNU diff's hash algorithm instead.
# -DHASH_STATS		For printing a one-liner hash statistics.


AR = tlib
AWK = @echo :
CC = tcc -v -N -mh
CFLAGS = 
CPPFLAGS = 
DEFS = -DHAVE_CONFIG_H
INSTALL = @echo :
INSTALL_DATA = copy
INSTALL_PROGRAM = copy
LDFLAGS = 
LEX = @echo :
LIBS = 
MAKEINFO = @echo :
RANLIB = @echo :
TEXI2DVI = @echo :

prefix = /usr/local
exec_prefix = /usr/local
transform = s,x,x,
bindir = $(exec_prefix)/bin
infodir = $(prefix)/info

COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(LDFLAGS) -e$@

.SUFFIXES:
.SUFFIXES: .c .obj
.c.obj:
	$(COMPILE) $<

ANSI2KNR = 
O = .o

.SUFFIXES: ._c ._o
.c._c:
	./ansi2knr $< > $@
._c._o:
	@echo $(COMPILE) $<
	@rm -f _$*.c
	@ln $< _$*.c && $(COMPILE) _$*.c && mv _$*.o $@ && rm _$*.c
.c._o:
	./ansi2knr $< > $*._c
	@echo $(COMPILE) $*._c
	@rm -f _$*.c
	@ln $*._c _$*.c && $(COMPILE) _$*.c && mv _$*.o $@ && rm _$*.c

INCLUDES = -I. -I$(srcdir)

HEADERS = recode.h charname.h
SOURCES = recode.c charname.c charset.c $(C_STEPS) $(L_STEPS)
OBJECTS = recode.obj charname.obj charset.obj $(STEPOBJS)
LIBHDRS = getopt.h pathmax.h
LIBSRCS = argmatch.c getopt.c getopt1.c error.c xmalloc.c xstrdup.c
LIBOBJS = argmatch.obj getopt.obj getopt1.obj error.obj xmalloc.obj xstrdup.obj

L_STEPS = ascilat1.l htmllat1.l ltexlat1.l txtelat1.l
C_STEPS = \
charset1.c charset2.c applemac.c atarist.c bangbang.c cdcnos.c \
ebcdic.c flat.c ibmpc.c iconqnx.c lat1asci.c lat1html.c lat1ltex.c \
lat1txte.c next.c
STEPOBJS = merged.obj \
charset1.obj charset2.obj applemac.obj atarist.obj bangbang.obj cdcnos.obj \
ebcdic.obj flat.obj ibmpc.obj iconqnx.obj lat1asci.obj lat1html.obj lat1ltex.obj \
lat1txte.obj next.obj

DISTFILES = readme news todo thanks copying install changelo.g \
configur.in acconfig.h aclocal.m4 mkinstal.ldi install-.sh \
makefile.in mergelex.awk recode.ti file-lat.in1 \
$(HEADERS) $(SOURCES) $(LIBHDRS) $(LIBSRCS) checkit \
ansi2knr.c ansi2knr.1 c-boxes.el texinfo.tex \
rfc1345.txt charname.sed charname.pl charset.sed charset.pl \
stamp-h.in config_h.in configur.e stamp-vt.i version.ti charset.ti \
recode.inf stamp-in.it initstep.h merged.c tags backlog \
readme.dos configdo.s dosfn makefile.os2 config_h.os2 config_h.tcc \
makefile.tcc libobjs.tcc objects.tcc

all: recode.inf recode.exe

info: recode.inf

recode.inf: recode.ti charset.ti version.ti
	cd $(srcdir) && $(MAKEINFO) --no-split recode.ti

dvi: recode.dvi

recode.dvi: recode.ti
	$(TEXI2DVI) $(srcdir)/recode.ti

version.ti: stamp-vt.i
stamp-vt.i: recode.ti configur.in
	echo "@set EDITION $(VERSION)" > version.tmp
		>> version.tmp
	echo "@set VERSION $(VERSION)" >> version.tmp
	if cmp -s version.tmp $(srcdir)/version.ti; then rm version.tmp; \
	else mv version.tmp $(srcdir)/version.ti; fi
	date > $(srcdir)/stamp-vti

recode.exe: initstep.h $(OBJECTS) librec.lib
	$(LINK) @objects.tcc librec.lib $(LIBS)

initstep.h: stamp-in.it
stamp-in.it: $(C_STEPS) merged.c
	@echo "updating initstep.h"
	@(cd $(srcdir) && sed -n 's/^\(module_[^ ]*\).*/  \1 ();/p' \
	  $(C_STEPS) merged.c ) > initstep.tmp
	@if cmp -s $(srcdir)/initstep.h initstep.tmp; then rm initstep.tmp; \
	else mv initstep.tmp $(srcdir)/initstep.h; fi
	date > $(srcdir)/stamp-init

merged.c: mergelex.awk $(L_STEPS)
	(cd $(srcdir) \
	  && $(AWK) -f mergelex.awk $(L_STEPS) \
	  && rm merged1.tmp merged2.tmp merged3.tmp) > merged.tm1
	$(LEX) -t8 merged.tm1 > merged.tm2
	grep -v '^# *line [0-9]' merged.tm2 > $(srcdir)/merged.c
	erase merged.tm1
	erase merged.tm2

charname.h: charname.sed charname.pl rfc1345.txt
	cd $(srcdir) && sed -n -f charname.sed rfc1345.txt | perl charname.pl

# The next rule, used with -jN, launches many parallel occurrences
# of the action.  This is bad.  Any idea for solving this, someone?
charset1.c charset2.c charset.ti: charset.sed charset.pl rfc1345.txt
	cd $(srcdir) && sed -n -f charset.sed rfc1345.txt | perl charset.pl

$(OBJECTS): $(ANSI2KNR) config.h
recode.obj charname.obj charset.obj $(STEPOBJS): recode.h
recode.obj: initstep.h getopt.h
charname.obj: charname.h

ansi2knr: ansi2knr.obj
	$(LINK) ansi2knr.obj $(LIBS)

librec.lib: $(LIBOBJS)
	erase librec.lib
	$(AR) librec.lib @libobjs.tcc
	$(RANLIB) librec.lib

$(LIBOBJS): config.h
getopt.obj getopt1.obj: getopt.h

CHECKING = @$(srcdir)/checkit $(srcdir)/COPYING

check: recode.exe
	@./recode --version
	$(CHECKING) texte texte
	$(CHECKING) texte latin1
	$(CHECKING) texte ibmpc
	$(CHECKING) texte iconqnx
	$(CHECKING) texte bangbang
	$(CHECKING) ascii-bs ebcdic
	@echo "All checks completed successfully."

autocheck:
	@echo "The following test may take part of an hour.  Be patient."
	@(./recode --auto-check | grep UNACH | grep -v '^flat') || exit 0

install: all
	$(srcdir)/mkinstalldirs $(bindir) $(infodir)
	$(INSTALL_DATA) $(srcdir)/recode.inf $(infodir)/recode.inf

uninstall:
	erase $(infodir)/recode.inf


tags: $(HEADERS) $(SOURCES) $(LIBHDRS) $(LIBSRCS)
	cd $(srcdir) && etags $(HEADERS) $(SOURCES) $(LIBHDRS) $(LIBSRCS)

mostlyclean:
	erase *.aux
	erase *.cp
	erase *.cps
	erase *.dvi
	erase *.fn
	erase *.fns
	erase *.ky
	erase *.log
	erase *.pg
	erase *.toc
	erase *.tp
	erase *.vr
	erase *.a
	erase *.o
	erase *._c
	erase *._o
	erase core
	erase core.*
	erase *.tmp
	erase yy.tab.*

clean: mostlyclean
	erase recode.exe

distclean: clean
	erase ansi2knr
	erase Makefile
	erase config.cac
	erase config.h
	erase config.log
	erase stamp-h
	erase config.sta

realclean: distclean
	erase stamp-vt.i
	erase version.ti
	erase charset.ti
	erase recode.inf
	erase stamp-in.it
	erase initstep.h
	erase charset1.c
	erase charset2.c
	erase charname.h
	erase merged.c
	erase tags

dist: $(DISTFILES)
	erase $(PRODUCT)-$(VERSION)
	mkdir $(PRODUCT)-$(VERSION)
	chmod 777 $(PRODUCT)-$(VERSION)
	@echo "Copying distribution files"
	@for file in $(DISTFILES); do \
	  ln $(srcdir)/$$file $(PRODUCT)-$(VERSION) 2> /dev/null \
	    || cp -p $(srcdir)/$$file $(PRODUCT)-$(VERSION); \
	done
	chmod -R a+r $(PRODUCT)-$(VERSION)
	tar chozf $(PRODUCT)-$(VERSION).tar.gz $(PRODUCT)-$(VERSION)
	erase $(PRODUCT)-$(VERSION)

makefile.tcc: configdo.s makefile.in
	cd $(srcdir) && perl configdo.s -tcc

libobjs.tcc: makefile.in
	erase $(srcdir)/libobjs.tcc
	for name in $(LIBOBJS) $(MSDOS_LIBOBJS); do \
	  echo $$name | sed 's/^/+ /;s/$$/bj \&/' >> $(srcdir)/libobjs.tcc; \
	done
	echo , >> $(srcdir)/libobjs.tcc

objects.tcc: makefile.in
	erase $(srcdir)/objects.tcc
	for name in $(OBJECTS); do \
	  echo $$name | sed 's/$$/bj/' >> $(srcdir)/objects.tcc; \
	done

distdos: $(DISTFILES) recode.exe
	@echo "Copying distribution files"
	@for file in $(DISTFILES); do \
	done

# For an explanation of the following Makefile rules, see node
# `Automatic Remaking' in GNU Autoconf documentation.
Makefile: makefile.in config.sta
	CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
config.sta: configur.e
	./config.status --recheck
configur.e: configur.in aclocal.m4
	cd $(srcdir) && autoconf

config.h: stamp-h
stamp-h: config_h.in config.sta
	CONFIG_FILES= CONFIG_HEADERS=config.h ./config.status
	date > stamp-h
config_h.in: stamp-h.in
stamp-h.in: configur.in aclocal.m4 acconfig.h
	cd $(srcdir) && autoheader
	date > $(srcdir)/stamp-h.in

# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
