#
# Makefile --
#
#      This file contains the Makefile of the PAPyRUS application.
#
# Copyright (C) 1996  Carlos Nunes - loscar@mime.univ-paris8.fr
#
# 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 of the License, 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.



CC  = gcc
CCC  = g++
CXX = g++

PAPYRUS_LIBRARY = /home/word/Papyrus/current

CXXDEFINES = -DPAPYRUS_LIBRARY=\"${PAPYRUS_LIBRARY}\"
CDEFINES   = -DPAPYRUS_LIBRARY=\"${PAPYRUS_LIBRARY}\"

CXXFLAGS = -s -m486 -O2 -Wall -ansi -pedantic  $(CXXDEFINES)
CFLAGS   = -s -m486 -O2 -Wall -ansi -pedantic  $(CDEFINES)


LIBS = -L/usr/X11R6/lib -lXpm -lX11 -ltcl7.5 -lm


SRCS =	attributes.cc	assert.cc   	main.cc  	commandsAM.cc		\
	commandsNZ.cc	container.cc  	isfuncs.cc  	frame.cc		\
	display.cc    	events.cc   	page.cc  	paragraph.cc   		\
	document.cc   	line.cc     	word.cc  	wordSegment.cc		\
	thePosition.cc	image.cc	util.cc		cursor.cc		\
	ascii_output.cc			ps_output.cc	papyrus_output.cc	\
	FontManager/fontManager.cc	FontManager/fontFamily.cc		\
	StyleManager/styleItem.cc	StyleManager/styleManager.cc		\
	../tcl/tclMain.c		../tcl/tclInit.cc			\
	../tcl/tclGet.cc							\
	../misc/shortcuts.c		../misc/parseAFM.c

OBJS =	attributes.o	assert.o   	main.o		commandsAM.o		\
	commandsNZ.o	container.o  	isfuncs.o  	frame.o			\
	display.o    	events.o   	page.o		paragraph.o   		\
	document.o   	line.o     	word.o		wordSegment.o		\
	thePosition.o	image.o		util.o		cursor.o		\
	ascii_output.o			ps_output.o	papyrus_output.o	\
	FontManager/fontManager.o	FontManager/fontFamily.o		\
	StyleManager/styleItem.o	StyleManager/styleManager.o		\
	../tcl/tclMain.o		../tcl/tclInit.o			\
	../tcl/tclGet.o								\
	../misc/shortcuts.o		../misc/parseAFM.o


INCS =  assert.h     	container.h  	events.h    	line.h			\
	types.h      	attributes.h 	cursor.h    	frame.h			\
	page.h       	word.h       	commands.h  	display.h		\
	globals.h    	paragraph.h  	isfuncs.h   	wordSegment.h	 	\
	image.h      	document.h   	margin.h    	thePosition.h		\
	util.h	     	output.h	marker.h    	papyrus.h		\
	FontManager/fontManager.h    	FontManager/fontFamily.h		\
	StyleManager/styleItem.h     	StyleManager/styleManager.h		\
	../tcl/mytcl.h			../tcl/tclGet.h				\
	../misc/shortcuts.h		../misc/parseAFM.h



all:	kernel


kernel: $(OBJS)
	$(CC) -o $@ $+ $(LIBS)


clean:
	\rm -f $(OBJS) *~ *.bak *.BAK bin/main



tar:
	@tar cvf kernel.tar Makefile.std $(SRCS) $(INCS)	\
			../misc/SpecialChars.c			\
			A_FAIRE*
	gzip -9 kernel.tar
	mv kernel.tar.gz kernel.tgz

depend:	
	cp Makefile Makefile.bak
	sed '/^#----- dependences -----/q' Makefile.bak >Makefile
	echo >>Makefile
	$(CXX) $(CXXFLAGS) -M $(SRCS) >>Makefile

#----- dependences -----
