Difference between revisions of "Makefile"

From Immersive Visualization Lab Wiki
Jump to: navigation, search
(New page: <pre> # This is a Makefile for compiling Fall 2010 CSE 167 projects. # It includes all .cpp files in the current directory. # To use on a different (non-lab) Linux setup, change the INCDIR...)
 
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 
<pre>
 
<pre>
# This is a Makefile for compiling Fall 2010 CSE 167 projects.
+
# This is a Makefile for compiling CSE 167 projects.
 
# It includes all .cpp files in the current directory.
 
# It includes all .cpp files in the current directory.
 
# To use on a different (non-lab) Linux setup, change the INCDIRS and LIBDIRS
 
# To use on a different (non-lab) Linux setup, change the INCDIRS and LIBDIRS

Latest revision as of 19:17, 4 October 2012

# This is a Makefile for compiling CSE 167 projects.
# It includes all .cpp files in the current directory.
# To use on a different (non-lab) Linux setup, change the INCDIRS and LIBDIRS
#   directories to point to the locations of the header files on your machine.
NAME	= triangle
ECHO	= @echo
CC	= @g++
LIBS	= -lglut -lGLU -lGL -lXmu -lXi -o triangle
LDFLAGS	= $(LIBS)
CFLAGS	= 
SOURCES = $(wildcard *.cpp)
OBJS = $(patsubst %.cpp, %.o, $(SOURCES))

.SUFFIXES: .cpp .h .o

.cpp.o:
	$(ECHO) "Compiling $<"
	$(CC) $(CFLAGS) -c -o $@ $<

$(NAME): $(OBJS)
	$(ECHO) "Linking $@..."
	$(CC) -o $@ *.o $(LIBS)
	$(ECHO) "Built $@!"

clean:
	$(RM) core *.o $(NAME)
	$(ECHO) "All clean!"

new:
	make clean
	make