# -------------------------------------------------------------------- 
# SMS Client, send messages to mobile phones and pagers		
#									
# Makefile								
#									
#  Copyright (C) 1997,1998,1999 Angelo Masci					
#									
#  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.	
#									
#  You can contact the author at this e-mail address:			
#									
#  angelo@styx.demon.co.uk						
#									
# -------------------------------------------------------------------- 
# $Id$
# -------------------------------------------------------------------- 

include ../../../Makefile.config

# --------------------------------------------------------------------

all: gs_api.a

test: test/test_api
	

clean:
	rm -f *.o 
	rm -f gs_api.a
	rm -f core log
	rm -f test/test_api test/test_log test/myfile.save

# --------------------------------------------------------------------

INCLUDE    = -I.. -I../..

# --------------------------------------------------------------------

../../logfile/logfile.o: ../../logfile/logfile.c ../../logfile/logfile.h
	cd ../../logfile ; $(MAKE) logfile.o

../../common/common.o: ../../common/common.c ../../common/common.h
	cd ../../common ; $(MAKE) common.o

gs_parser: 
	cd ../ ; $(MAKE) gs_parser.a

# --------------------------------------------------------------------

gs_api.a: gs_create.o gs_load.o gs_save.o gs_type.o gs_getvar.o gs_getlist.o gs_getdict.o  
	$(AR) gs_api.a gs_create.o gs_load.o gs_save.o gs_type.o gs_getvar.o gs_getlist.o gs_getdict.o
	$(RANLIB) gs_api.a

test/test_api: test/test_api.c gs_api.a ../../logfile/logfile.o ../../common/common.o gs_parser
	$(CC) $(CFLAGS) $(INCLUDE) test/test_api.c -o test/test_api gs_api.a ../../logfile/logfile.o ../../common/common.o ../gs_parser.a -DLOGLEVEL=3 -DLOGFILE="\"test_log\"" 

gs_create.o: gs_create.c gs_api.h
	$(CC) $(CFLAGS) $(INCLUDE) -c gs_create.c

gs_load.o: gs_load.c gs_api.h
	$(CC) $(CFLAGS) $(INCLUDE) -c gs_load.c

gs_save.o: gs_save.c gs_api.h
	$(CC) $(CFLAGS) $(INCLUDE) -c gs_save.c

gs_type.o: gs_type.c gs_api.h
	$(CC) $(CFLAGS) $(INCLUDE) -c gs_type.c

gs_getvar.o: gs_getvar.c gs_api.h
	$(CC) $(CFLAGS) $(INCLUDE) -c gs_getvar.c

gs_getlist.o: gs_getlist.c gs_api.h
	$(CC) $(CFLAGS) $(INCLUDE) -c gs_getlist.c

gs_getdict.o: gs_getdict.c gs_api.h
	$(CC) $(CFLAGS) $(INCLUDE) -c gs_getdict.c

# --------------------------------------------------------------------

