Hi,
I am new to writing makefiles and am struggling to write a working makefile that compiles and links several cpp, mm and m files to create a dylib binary.
The makefile I've written is below
Cheers
David
I am new to writing makefiles and am struggling to write a working makefile that compiles and links several cpp, mm and m files to create a dylib binary.
The makefile I've written is below
Cheers
David
Code:
all: $(SOURCESCPP) $(OBJECTSCPP)
CC=g++
CCFLAGS=-c -Wall -m64
INCPATH=-I/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Headers/ -I/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include
LDFLAGS=-dynamiclib -framework AppKit -framework OpenGL -framework Foundation -framework JavaVM
SOURCESCPP=Images.cpp
SOURCESMM=GraphicsContextProperties.mm GraphicsContextPropertiesList.mm MyGL.mm
SOURCESM=OpenGLAlertsUtilityToolkit.m OpenGLController.m
OBJECTSCPP=$(SOURCESCPP:.cpp=.o)
OBJECTSMM=$(SOURCESMM:.mm=.o)
OBJECTSM=$(SOURCESM:.m=.o)
.cpp.o:
$(CC) $(CCFLAGS) $(INCPATH) $<
.mm.o:
$(CC) $(CCFLAGS) $(INCPATH) $<
.m.o:
$(CC) $(CCFLAGS) $(INCPATH) $<
LIBRARY=-o libAvistoGL.dylib
clean:
rm -rf *.o *.dylib