# Go to http://www.gnu.org/manual/make-3.77/html_mono/make.html for a makefile tutorial
# Makefile for MacOS X.
# This makefile is based off of the example one distributed in ECS 175 at UC Davis
# in the Fall of 2002. It was modified by Ryan Poling, rjpoling@poboxes.com with the help
# of Ben Forsyth, bforsyth@cs.ubc.ca.
# Note, to use this file, include the names of all the .cpp files you wish to compile below
# where it says "FORMSRC." The name of the executable is "runme," although you can change this.
# When using this for the first time, you must type "touch depend.mak" on the command line.
# This will create a blank dependency file. Then type "make depend" to fill it in.
# Every time you add another source file to the list, type "make depend" again.
# To build and run the project, type "make run," or to just build it, type "make."
#
# Definitions for build options
#
FLTK = /usr/local
CXX = g++
LDLIBS = -L$(FLTK)/lib/ -framework Carbon -framework ApplicationServices -lsupc++
GLDLIBS = -framework AGL -framework OpenGL
CXXFLAGS = -g
LDFLAGS = $(LDLIBS) $(GLDLIBS) -lfltk_gl -lfltk -lm
CC = $(CXX)
CFLAGS = $(CXXFLAGS)
#
# Source and object file definitions
#
MAINSRC = runme.cpp
# These are all of the .cpp files which are to be compiled
FORMSRC = GLCanvas.cpp GUIApp.cpp Vector.cpp Point_KJ.cpp Color.cpp ListOfPoints.cpp ProjPoint.cpp ListOfProjPoints.cpp ListOfVectors.cpp Transformation.cpp DataClass.cpp SliceClass.cpp ListOfSlices.cpp Extent.cpp ColorMapCanvas.cpp
# The % character matches any substring, so %.cpp matches all .cpp files.
EXEC = $(MAINSRC:%.cpp=%)
FORMOBJ = $(FORMSRC:%.cpp=%.o)
#
# Dependencies for building project
#
# note, $@ is a macro which gives the file name of the target.
# $? is the names of dependencies which are newer than the target with spaces between them.
all: $(EXEC) macosx
runme: runme.o $(FORMOBJ)
$(CXX) -o $@ runme.o ${FORMOBJ} $(LDFLAGS)
#
# Dependencies for building object files
#
include depend.mak
#
# Helper rules
#
depend:
-rm -f depend.mak
g++ -MM $(CXXFLAGS) $(MAINSRC) $(FORMSRC) > depend.mak
tidy:
-rm -f *~
-rm -f *.o
clean: tidy
-rm -f $(EXEC)
remake: clean all
run: all
./runme
macosx:
/Developer/Tools/Rez -t APPL -o runme /usr/local/include/FL/mac.r