# -----------------------------------------------------------------------------
# TERRY EVANS (tevans@cs.utah.edu or tevans@unislc.slc.unisys.com)
# BIN MAKEFILE -- Created on Tue Jun 28 18:55:02 MST 1994
#
# If you have any question about this makefile you may direct them to me at 
# one of the above E-mail addresses.
# -----------------------------------------------------------------------------

# -----------------------------------------------------------------------------
# The following is for maintaining an archive for a project
# -----------------------------------------------------------------------------

AR = ar
ARFLAGS = ur
LIBRARY =
LIBPATH = 
LIBNAME =
# If you want to add the .o file to a library then add the following to the
# rules for a target. (ie: append it right after the example above)
#	$(AR) $(ARFLAGS) $(LIBRARY) $@
#	$(RANLIB) $(LIBRARY)
RANLIB = ranlib

# -----------------------------------------------------------------------------
# The following is to generate various object file and executables.
# -----------------------------------------------------------------------------

CC = gcc
CPP = g++
CFLAGS= -g -Wall
CFLAGS= -O -pipe -fomit-frame-pointer -fstrength-reduce -Wall
#CPPFLAGS= -O -pipe -fomit-frame-pointer -fstrength-reduce -Wall
# Note: You can't use -fomit-frame-pointer with debugger
EXE = sfxclient
CLASS = 
ASSIGNMENT = 
SOURCES = main.c error.c
OBJECTS = ${SOURCES:.c=.o}

#VPATH= .:../include
#DEBUG= -DDEBUG

# -----------------------------------------------------------------------------
# PROJECTS
# -----------------------------------------------------------------------------

all: $(EXE)

$(EXE): $(OBJECTS)
	$(CC) $(CCFLAGS) -o $@ $(OBJECTS) $(LIBPATH) $(LIBNAME)

new: clean $(EXE) strip


# -----------------------------------------------------------------------------
# UTILITIES
# -----------------------------------------------------------------------------
# clean removes all .o files and the executable so you can start over with a 
#   new make.
# strip executes the strip command (removes symbol table) on a file.
# -----------------------------------------------------------------------------

clean: FORCE
	@echo Removing $(EXE) executable...
	@rm -f $(EXE)
	@echo Done
	@echo
	@echo Removing following object files:...
	@echo $(OBJECTS)
	@rm -f $(OBJECTS)
	@echo Done

strip: FORCE
	@echo Stripping $(EXE) executable...
	@strip $(EXE)
	@echo Done

depend:
	makedepend -- $(CFLAGS) -I/usr/lib/gcc-lib/i486-linux/2.5.8/include -- $(SOURCES)


# -----------------------------------------------------------------------------
# The empty FORCE target is so that a target with a FORCE dependency will
# always execute even though the name of the target might exist.
# -----------------------------------------------------------------------------

FORCE:


# -----------------------------------------------------------------------------
# DEPENDENCIES
# -----------------------------------------------------------------------------

# Examples of some dependencies
# test.o: ${@:.o=.c} ${@:.o=.h}
#	$(CC) $(DEBUG) $(DEPFLAGS) ${@:.o=.c} $(CCFLAGS) $@

.c.o:
	$(CC) $(DEBUG) $(DEPFLAGS) $(CFLAGS) -c $*.c

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

main.o: /usr/include/fcntl.h /usr/include/features.h /usr/include/sys/cdefs.h
main.o: /usr/include/sys/types.h /usr/include/linux/types.h
main.o: /usr/include/linux/fcntl.h /usr/include/stdlib.h
main.o: /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h
main.o: /usr/include/errno.h /usr/include/linux/errno.h
main.o: /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h
main.o: /usr/include/alloca.h /usr/include/stdio.h /usr/include/libio.h
main.o: /usr/include/_G_config.h /usr/include/string.h
main.o: /usr/include/sys/time.h /usr/include/linux/time.h
main.o: /usr/include/sys/time.h /usr/include/unistd.h
main.o: /usr/include/posix_opt.h /usr/include/gnu/types.h global.h error.h
main.o: main.h
error.o: /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
error.o: /usr/include/sys/cdefs.h /usr/include/features.h
error.o: /usr/include/stdlib.h
error.o: /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h
error.o: /usr/include/errno.h /usr/include/linux/errno.h
error.o: /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h
error.o: /usr/include/alloca.h
error.o: /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h error.h
