# -------------------------------------------------------------------- 
# 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: resource.a

clean:
	$(RM) *.o *.bak resource.a test_resource

test: test_resource

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

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

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

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

resource.a: resource.o
	$(RM) resource.a
	$(AR) resource.a resource.o
	$(RANLIB) resource.a

resource.o: resource.c ../common/common.h ../logfile/logfile.h resource.h
	$(CC) $(CFLAGS) -c resource.c $(INCLUDE)

test_resource.o: test_resource.c 
	$(CC) $(CFLAGS) -c test_resource.c $(INCLUDE) -DMLOGLEVEL=3 -DMLOGFILE="\"test_log\""

test_resource: test_resource.o resource.a gs_parser ../common/common.o ../logfile/logfile.o
	$(CC) $(CFLAGS) test_resource.o -o test_resource resource.a ../parser/gs_parser.a ../common/common.o ../logfile/logfile.o

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

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

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


