Subject: makefiles

From: "John R. Murphy" <[email-masked]>
Date: Tue, 11 Apr 1995 00:44:25 GMT

you had asked for a makefile with a makeedepend featyre.
I think this one should work, but no real guarantees..

# the following line contains the name of the output file
PROGNAME	=	

# the following line contains the list of the .c files (or .C for c++, etc)
SRCS		=	

OBJS		=	$(SRCS:.c=.o)

# the following line contains the include directories: -Idirectory_name
INCDIRS		=	

# the following line contains the library directories: -Ldirectory_name
LIBDIRS		=	

# the following line contains the included libraries: -lm 
LIBS		=	-lm 

# choose your compiler, note that SGIs only have cc and not gcc
CC		=	cc

CFLAGS		=	-g -O

default:	all

all:		$(PROGNAME)

$(PROGNAME):	$(OBJS)
		$(CC) $(CFLAGS) $(OBJS) -o $(PROGNAME) $(LIBDIRS) $(LIBS)

.c.o:		
		$(CC) $(CFLAGS) -c $*.c -o $*.o $(INCDIRS)

neat:
		@-echo 'Making neat...'
		@rm -f *.bak *~ #*# core

clean:	
		@-echo 'Making clean...'
		@rm -f *.o *.bak *~ #*# core

tags:
		@-echo 'Making tags...'
		@etags *.[Cch]

depend:
		@-echo 'Making dependencies...'
		@cp Makefile Makefile.bak
		@makedepend -w0 -- $(INCDIRS) -- $(SRCS)
		@mv Makefile Makefile.tmp
		@awk '  NR == 1,/^# DO NOT DELETE THIS LINE/    {print; next} \
			NR == 2                                 {print; next} \
			$$2 !~ /^\//                            {print $$0}'  \
			Makefile.tmp > Makefile
		@rm Makefile.tmp

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