############################################################################
#** interpcom-1.2  (mini-command interpreter)                             **
#** general makefile                                                      **
#**                                                                       **
#** Copyright (C) 1999  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			 					  **
#**                                                                       **
############################################################################
export CFLAGS
export MAKE

all :  libint_m.a test/test_ test2/test_

OBJS =  command.o com_sys.o ee.o interp.o

libint_m.a : $(OBJS)
	ar cr libint_m.a *.o 

test/test_ :
	cd test; $(MAKE)

test2/test_ :
	cd test2; $(MAKE)
	

#
command.o :  ../command.c interp.h
	$(CC) ../command.c  -c $(CFLAGS) -o command.o
#
ee.o :  ../ee.c interp.h
	$(CC) ../ee.c       -c $(CFLAGS) -o ee.o
#


clean-all :
	rm -f *.o libint_m.a *bck *%
	cd test; $(MAKE) clean-all
	cd test2; $(MAKE) clean-all


clean :
	rm -f *.o */*.o */*/*.o *bck *% */*bck */*% */*/*bck */*/*%

OBJSD = command_s.o com_sys_s.o ee_s.o interp_s.o 

libint_m.so.1.2 : $(OBJSD)
	$(CC) -shared -Wl,-soname,libint_m.so.1 -o libint_m.so.1.2 *_s.o

$(OBJSD) : %_s.o : %.c
	$(CC) -c $(CFLAGS) -fPIC $< -o $@
