#========================================================================
#  Copyright (C) VMware, Inc. 1986-2011.  All Rights Reserved..
# 
#  Name - Makefile.install
# 
#  Usage: this makefile is used by the buildsystests script in the same
#         directory. Users should use 'buildsystests' instead of 'make'.
#
#  Description - Makefile for misc public domain programs used by GemStone
# 
#  $Id: Makefile.install,v 1.5 2008-01-09 22:50:48 stever Exp $
# 
#========================================================================

CFLAGS+= -g

# Use strict gcc options in preference to lint
GCCFLAGS= -Wall -pedantic -Wshadow -Wpointer-arith -Wwrite-strings \
    -Wid-clash-32 -Wconversion -Wstrict-prototypes \
    -Wmissing-prototypes -Wnested-externs -Winline


RM = rm -f
LINK.c = $(CC) $(CFLAGS)
COMPILE.c = $(CC) $(CFLAGS) -c

SOURCES = Makefile fileopentest.c getdtablesize.c \
  gethostbyname.c getservbyname.c getservbyport.c

TARGETS = fileopentest getdtablesize gethostbyname getservbyname \
  getservbyport shmem asyncio getpwnam

all:	$(TARGETS)

clean:
	-$(RM) *.o

clobber:
	-$(RM) $(TARGETS)

shar:
	makekit -m -s64k -nGemStoneTools
#	makekit -oMANIFEST -s64k -nGemStoneTools $(SOURCES)

tar:
	tar -cvAf GemStoneTools.tar $(SOURCES)

# Here are the basic dependencies.  The rules are provided because Sun's
# Make seems to be horribly broken.  Simple lines of the form,
#
# fileopentest: fileopentest.c
#
# (for instance) seem to work just fine with Gnu make.

fileopentest: fileopentest.c
	$(LINK.c) -o $@ fileopentest.c $(LDLIBS)

getdtablesize: getdtablesize.c
	$(LINK.c) -o $@ getdtablesize.c $(LDLIBS)

gethostbyname: gethostbyname.c
	$(LINK.c) -o $@ gethostbyname.c $(LDLIBS)

getservbyname: getservbyname.c
	$(LINK.c) -o $@ getservbyname.c $(LDLIBS)

getservbyport: getservbyport.c
	$(LINK.c) -o $@ getservbyport.c $(LDLIBS)

getpwnam: getpwnam.c
	$(LINK.c) -o $@ getpwnam.c $(LDLIBS)

shmem: shmem.c
	$(LINK.c) -I$(GEMSTONE)/include -o $@ shmem.c $(LDLIBS)

asyncio: asyncio.c
	$(LINK.c) -I$(GEMSTONE)/include -o $@ asyncio.c $(LDLIBS) $(AIO_LIB)

