# IsOn's Makefile
#
# As usual comment lines are those beginning with a # character;  I've
# left some extra comments in there to give more example values for some
# Make variables.

# Your favorite C Compiler, and flags.
CC=cc
#CC=gcc

CFLAGS=-O
#CFLAGS=-O2
#CFLAGS=-g
#CFLAGS=-ansi -fullwarn -woff 211,269,270,303,309 -g -I.. -L..
#CFLAGS=-g -Wall -Wshadow -Wconversion -Wstrict-prototypes -Wmissing-prototypes


# Link flags -- add the RPC library(s) here if you want to use it.
#
# For SunOS, you just need -lrpcsvc.  That may do it for most systems.
#
# My system needs to libraries, because the librpcsvc library relies on
#   functions not included in libc (it needs the XDR routines).
#   So I add -lrpcsvc -lsun here to get it to link correctly.
#
# If you aren't using RPC, you can just set LFLAGS to empty.


LFLAGS=-lrpcsvc
#LFLAGS=-lrpcsvc -lsun
#LFLAGS=-lrpcsvc -lsun -lc_s
#LFLAGS=


# Set STRIP to -s if you want a much smaller binary (stripped of debugging
#   symbols).

STRIP=-s
#STRIP=


# Definitions.  EDIT config.h!  PLEASE read through that whole file,
# and make the necessary changes!

DEFS= #-DHAVE_STDARGH=0 -DRPC=1 -DDEBUG=1




### SHOULD NOT NEED TO EDIT BEYOND THIS POINT ###

# Source file name minus .c, and compiled exectuable's pathname.
PROG=ison
OFILE=ison
VERS=5.0
TARNAME=$(PROG)$(VERS).tar

BLURB=Blurb
PACKAGE=INSTALL patchlevel.h $(PROG).1 config.h ison.h Makefile $(PROG).c

all: $(PROG)

$(PROG): $(PROG).c config.h ison.h
	$(CC) $(CFLAGS) $(DEFS) $(PROG).c -o $(OFILE) $(LFLAGS) $(STRIP)
	-@ls -l $(OFILE)

# For my system:
irix:
	cc -O3 -DRPC=1 $(PROG).c -o $(OFILE) -lrpcsvc -lsun -lc_s -s
	@-rm -f *.[ou]
	@-chmod 755 $(OFILE)
	@ls -l $(OFILE)
	mv ./$(OFILE) $(HOME)/bin

debug:
	cc -g -DRPC=1 -DDEBUG=1 $(PROG).c -o $(OFILE) -lrpcsvc -lsun

shar:
	shar $(PACKAGE) | cat $(BLURB) - > $(PROG).shar

tar:
	( cd .. ; tar cvf ./$(TARNAME) ./ison ; cd ./ison )
	mv ../$(TARNAME) .
	-@ls -l $(TARNAME)

tar2:
	tar cvf $(PROG).tar $(PACKAGE)

gz: tar
	gzip -v $(TARNAME)
	-@ls -l $(TARNAME).gz

finst: gz
	chmod 644 $(TARNAME).gz
	mv $(TARNAME).gz /usr/people/ftp/pub/mgleason

clean:
	rm -f core $(OFILE)

clobber: clean
	rm -i $(PACKAGE)
