Skeleton Makefile

Here is the skeleton of a Makefile you can use to start managing projects in CS-701. To use it, replace the material inside angle brackets (< >) with appropriate text (or actual tab characters in the case of <tab>), and provide values for the make variables LDFLAGS (options to be passed to ld), HDRS (list of header files), SRCS (list of .cc files), and EXEC (name of the executable file).

Note that the text inside the box has a left margin that should not be there in your real Makefile. In particular, the tab characters must be in column 1 of the file in order to work.

Consult the using make web page for more information on how to use and extend this skeleton file.


    # $Id$

    #   Makefile for <Project Name>
    #   CS-701, <Semester>
    #   <Your Name>

    #   $Log$
    #

    CXXFLAGS  = -g -Wall -Wwrite-strings $(DEBUG_FLAG)
    LDFLAGS   =

    HDRS      = 
    SRCS      = 
    OBJS      = $(SRCS:.cc=.o)
    EXEC      = 

    default : $(EXEC)

    $(EXEC) : $(OBJS)

    clean   :
    <tab>rcsclean
    <tab>rm -f *.o *.bak core $(EXEC)

    depend  : $(HDRS) $(SRCS)
    <tab>makedepend -- $(CXXFLAGS) -- $(SRCS)