############################################################################
#** interpcom-2.3   (command interpreter)                                 **
#** test programs for the interpcom library : makefile                    **
#**                                                                       **
#** Copyright (C) 2001  Jean-Marc Drezet                                  **
#**                                                                       **
#**  This library is free software; you can redistribute it and/or        **
#**  modify it under the terms of the GNU Library General Public          **
#**  License as published by the Free Software Foundation; either         **
#**  version 2 of the License, or (at your option) any later version.     **
#**									  **
#**  This library 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    **
#**  Library General Public License for more details. 			  **
#**									  **
#**  You should have received a copy of the GNU Library General Public    **
#**  License along with this library; if not, write to the Free		  **
#**  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.   **
#**                                                                       **
#** Please mail any bug reports/fixes/enhancements to me at:              **
#**      drezet@math.jussieu.fr                                           **
#** or                                                                    **
#**      Jean-Marc Drezet                                                 **
#**      Institut de Mathematiques                                        **
#**      Aile 45-55                                                       **
#**      2, place Jussieu                                                 **
#**      75251 Paris Cedex 05                                             **
#**      France			 					  **
#**                                                                       **
############################################################################

all : test_ test2 test_in

nothr : test_nothr test2_nothr

test_ : ../libinter.a main.o
	$(CC) main.o ../libinter.a -lm $(LIBS) -o test_


test_nothr : ../libinter_nothr.a main.o
	$(CC) main.o ../libinter_nothr.a -lm -o test_nothr

main.o : main.c
	$(CC) -c main.c $(CFLAGS) -I.. -o main.o

test2 : ../libinter.a main2.o int_ini.o
	$(CC) main2.o int_ini.o ../libinter.a -lm $(LIBS) -o test2

test2_nothr : ../libinter_nothr.a main2.o int_ini.o
	$(CC) main2.o int_ini.o ../libinter_nothr.a -lm -o test2_nothr

test_in : ../libinter.a test_in.o
	$(CC) test_in.o ../libinter.a -lm $(LIBS) -o test_in 

int_ini.c : ../convert/interp-convert
	../convert/interp-convert ./interp2.ini ./int_ini.c int_txt int_nb

../convert/interp-convert :
	cd ../convert; $(MAKE)

shared : test_s test2_s test_in_s

test_s : main.o
	$(CC) main.o -lm -lpthread -linter -o test_s

test2_s : main.o int_ini.o
	$(CC) main2.o int_ini.o -lm -linter_nothr -o test2_s

test_in_s : test_in.o
	$(CC) test_in.o -lm -lpthread -linter -o test_in_s

main2.o : main2.c
	$(CC) -c main2.c $(CFLAGS) -I.. -o main2.o

int_ini.o : int_ini.c
	$(CC) -c int_ini.c $(CFLAGS) -I.. -o int_ini.o

test_in.o : test_in.c
	$(CC) -c test_in.c $(CFLAGS) -I.. -o test_in.o

clean-all :
	rm -f test_ test2 test_in *.o *bck *% *~ int_ini.c *txt *out *_nothr
	cd extra; $(MAKE) clean-all

clean :
	rm -f *.o *bck *% *~ int_ini.c *txt *out
	cd extra; $(MAKE) clean

