#  Makefile
#	by Tim O'Malley
#
#
# to use this file you must replace the variables
#	SRCS	OBJS	&    TARGET
# with the names of your source files and .o files and final prgm name
#
#		Happy Programming
#

# This sets which files we are going to compile
SRCS = nmsgs.c error.c generic.c getgrplist.c setup.c readgrp.c checkgrp.c
OBJS = nmsgs.o error.o generic.o getgrplist.o setup.o readgrp.o checkgrp.o
TARGET = nmsgs

# This is the set of programs to use -- assumes a sane path
CC = cc
LINT = lint
DEBUG = gdb
RM_CMD = rm -f
TAR_CMD = tar
COMPRESS_CMD = compress -f

# The set of flags to the above commands
CFLAGS = -g $(INCLDIR)
LDFLAGS = $(LIBDIR) $(LIBS)
LINTFLAGS = -h -b -x $(INCLDIR) $(LDFLAGS)
RMFLAGS = *~ *.bak *.o $(TARGET)
SRCDIR = .
BACKUPFILE = $(SRCDIR)/$(PRGM).tar

#################################################################
#	you shouldn't have to change anything below here	#
#################################################################

all:	$(TARGET)

$(TARGET):	$(OBJS)
	$(CC) -o $(TARGET) $(OBJS) $(LDFLAGS)

.c.o:
	$(CC) $(CFLAGS) -c -o $*.o $*.c
 
clean:
	$(RM_CMD) $(RMFLAGS)

lint:
	$(LINT) $(LINTFLAGS) $(SRCS)

saber:
	$(SABER) $(CFLAGS) $(LDFLAGS) $(SRCS) $(LIBS)

dbx:	$(TARGET)
	$(DEBUG) $(TARGET)

backup:
	$(TAR_CMD) -cvf $(BACKUPFILE) $(SRCDIR)
	$(COMPRESS_CMD) $(BACKUPFILE)

# DO NOT DELETE THIS LINE -- make depend depends on it.
