######################################################################
#
# generic Makefile
# SPDsoft 1995
#
#

CC			= cc
#CC			= gcc
CCFLAGS		=

INCS		= 

######################################################################
#
# uncomment your system...
# Default to native cc in IRIX 5.3
#
# Options:
#	-D_BSD_ for BSD systems
#	-DPATH_SEP=<your path separator> for other than unix
#	-DMYGETOPT if your system has not getopt(3C)
#			(you can use included getopt.c, add it by hand :( )
#
######
# Raw gcc options
#
##CCFLAGS	= -Wall $(INCS) -O -target  $(TARGET_ARCH:-%=%)

######
# gcc + glibc options
#
##INCS		= -I/usr/local/glibc/include
##CCFLAGS	= -Wall $(INCS) -O -target  $(TARGET_ARCH:-%=%)

######
# Convex
#
##CCFLAGS	= -ext -O3 -uo $(INCS)

######
# hp 9000; hp-ux
#
##CCFLAGS	= $(INCS) -Aa -O

######
# SGI IRIX 5
#
CCFLAGS		= $(INCS) -ansi -mips2 -O2

######                                                      
# SGI IRIX 5 + gcc
#
##CCFLAGS   = -ansi -O -mips2 -mcpu=r4000 -pedantic

######
# SunOS 4.1.3
#
##CCFLAGS	= $(INCS) -O -target  $(TARGET_ARCH:-%=%) -D_BSD_

######
# Solaris 2.3/2.4 + gcc
#
##CCFLAGS	= -Wall $(INCS) -O 

######################################################################
#
# installation options
#

######
# installation dir
#

#BIN_DIR = $(HOME)/bin
BIN_DIR = /usr/local/etc
MAN_DIR = /usr/local/man/man1

INSTALL = bsdinst -c -m 0755 -s 
INSTALL_DATA = bsdinst -c -m 0644
#INSTALL = install -c -o root -g bin -m 0755 -s 

######################################################################


EXECS = bsplit bjoin

all: $(EXECS)

.SUFFIXES: .c

.c: 
	$(CC) $(CCFLAGS) $< -o $@ $(LIBS)

clean:	
	rm -f *.o core tags

clobber:	clean
	rm -f $(EXECS)

new:	clobber
	make all

strip:	$(EXECS)
	strip $(EXECS)

install: $(EXECS)
	$(INSTALL) $? $(BIN_DIR)

install.man:
	$(INSTALL_DATA) bsplit.man $(MAN_DIR)/bsplit.1
	sh -c 'cd $(MAN_DIR) && ln bsplit.1 bjoin.1'

uninstall:
	sh -c 'cd $(BIN_DIR) && rm -f $(EXECS)'

