# -------------------------------------------------------------------- 
# SMS Client, send messages to mobile phones and pagers		
#									
# Makefile								
#									
#  Copyright (C) 1997,1998 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_parser.a

test: test/test_parser

clean:
	$(RM) gs_parser.a  
	$(RM) *.o 
	$(RM) *.bak
	$(RM) test/test_parser

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

INCLUDE = -I..

gs_parser.a: gs_list.o gs_parser.o gs_token.o gs_translate.o gs_io.o
	$(AR) gs_parser.a gs_list.o gs_parser.o gs_token.o gs_translate.o gs_io.o
	$(RANLIB) gs_parser.a

gs_list.o: gs_list.c gs_token.h ../common/common.h
	$(CC) -g  $(CFLAGS) $(INCLUDE) -c gs_list.c

gs_io.o: gs_io.c gs_io.h ../common/common.h
	$(CC) -g  $(CFLAGS) $(INCLUDE) -c gs_io.c

gs_parser.o: gs_parser.c gs_token.h ../common/common.h gs_parser.h
	$(CC) -g $(CFLAGS) $(INCLUDE) -c gs_parser.c

gs_token.o: gs_token.c gs_token.h ../common/common.h gs_list.h
	$(CC) -g $(CFLAGS) $(INCLUDE) -c gs_token.c

gs_translate.o: gs_translate.c gs_token.h ../common/common.h gs_list.h
	$(CC) -g $(CFLAGS) $(INCLUDE) -c gs_translate.c

test/test_parser: gs_parser.a test/test_parser.c ../logfile/logfile.o ../common/common.o
	$(CC) -g $(CFLAGS) $(INCLUDE) test/test_parser.c gs_parser.a -o test/test_parser ../common/common.o ../logfile/logfile.o -DMLOGLEVEL=3 -DMLOGFILE="\"test_log\""

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

../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

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


