# Makefile for geotouch...

#-----------------------------------------------------------------------------
# Compiler options
#-----------------------------------------------------------------------------

SHELL		= /bin/sh

CC		= gcc
CPPFLAGS	= -ansi -Wall
CFLAGS		= -g -O $(CPPFLAGS)

F77		= f77
FFLAGS		= -g -O

AR		= ar
AR_OPTS		= rcv

RANLIB		= ranlib

#-----------------------------------------------------------------------------
# Directories and libraries
#-----------------------------------------------------------------------------

INCDIRS		= -I. -I..

#-----------------------------------------------------------------------------
# Generic make target
#-----------------------------------------------------------------------------

FILES = getline.o jstring.o
LIB = libcstr.a

all: tag_start $(LIB) tag_end

$(LIB): $(FILES)
	rm -f $(LIB)
	$(AR) $(AR_OPTS) $(LIB) $(FILES)
	$(RANLIB) $(LIB)
	mv $(LIB) ../lib

.c.o:	
	@echo "Compiling" $< "..."
	$(CC) $(CFLAGS) $(INCDIRS) \
	-c $<
	@echo

.f.o:
	@echo "Compiling" $< "..."
	$(F77) $(FFLAGS) \
	-c $<
	@echo

#-----------------------------------------------------------------------------
# Build commands - tags
#-----------------------------------------------------------------------------

tag_start:
	@echo
	@echo "Compiling " $(LIB) "(`date`)..."
	@echo

tag_end:
	@echo
	@echo "Compilation complete (`date`)"
	@echo

#-----------------------------------------------------------------------------
# Build commands - maintenance
#-----------------------------------------------------------------------------

distrib:

clean:
	rm -f *.o core

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









