Compile OF from MakeFile on OS X for Web OS

Ok so this is a bit weird…but basically I’m working on porting OF to WebOS/HP TouchPad, and I need to do command-line compilation to get things on the device.

I have everything running smoothly as a simulator (created an ofxWebOS addon that replaces the windowing system with the PDK SDL libs, get touches/multitouch/etc), so I’m thinking that getting things on the device will basically be a matter of linking all of the iPhone ARM libraries correctly along with the PDK ARM stuff and all of the OF, project and addon src files.

I basically right now have the MakeFiles from Linux OF, and I have a bash script from the WebOS PDK (native dev) that compiles an example to the device with no problems. I need to make a mashup of the two more or less, basically taking the OF MakeFile and switching out the PDK compiler/linking the PDK libraries/etc.

I realize this is super vague, I may have more specific questions once I get things rolling I think my questions are:

  1. Does this make sense overall? This should (in theory) work if I do the above right?
  2. Does anyone have any advice on the strategy I should take?
  3. Are there any OS X/Universal makefiles somewhere? I’d love to just generate one from XCode but that doesn’t seem possible :confused: Am I crazy to think that I could slightly modify the Linux makefiles and they’ll work?

Thanks,
STeve

  1. Does this make sense overall? This should (in theory) work if I do the above right?

yes it should, i don’t think that using the iphone libraries will work though. i haven’t seen hp webos but for what you tell it seems to be a full linux/unix so you shouldn’t have any problem recompiling the libraries again. then put them in a webos folder inside each library folder as it’s done with the rest of the platforms

  1. Does anyone have any advice on the strategy I should take?

the makefiles are you best bet, the last ones in github (the most updated are in the development branch) are actually being used for android and linux so actually you should just need to detect the platform using uname and with that set the LIBSPATH var to webos. the makefile will then look for the libraries in that directories.

  1. Are there any OS X/Universal makefiles somewhere? I’d love to just generate one from XCode but that doesn’t seem possible :confused: Am I crazy to think that I could slightly modify the Linux makefiles and they’ll work?

you don’t need osx makefiles for this, you are compiling for webos but yes i’ve used them under osx using a similar strategy: use uname to detect Darwin and set LIBSPATH to osx you’ll need to set up some flags for gcc that are different in osx than linux but it works

Wow, totally missed this, I guess the new forum doesn’t email you with replies by default :-\

Thanks for your help Arturo, I think this clears things up…I’ll work from the latest makefiles on GitHub and see what happens! I think the best bet will be getting the basic OF app to compile, then work on getting it to compile for device and seeing if I need to recompile the libraries (most likely do…).

WebOS is basically using SDL and a custom version of GCC that compiles for ARM processors, its pretty simple on the technical side but not a lot of information out there…

OK so I’m getting close, but I’m at a bit of a stumped point. I’ve never used MakeFiles before (or compiled from the command line) but I’m starting to get the hang of it and most of it makes sense…

The reason I’m compiling OF for OS X first is that I think if I get that going/get a handle on this then it’ll be a lot simpler for me to move over to doing all of this for WebOS. I’m trying to do this in pieces to keep my sanity. I first got an ofxWebOS addon working that essentially compiles an OS X emulator for the Palm PDK (using their custom SDL for windowing and touch events), so now I want to do the opposite and compile OF from command line since I know it should work if it compiles in XCode, I’m just not doing it right. After that I think I should be able to jump in and more or less put the two together and have OF running on the device.

I think the issue I’m having has to do with the linux makefiles using -lopenFrameworksDebug as an included library (and looking for .so files), which doesn’t seem to translate to OS X (or I very possibly am doing something wrong). I’ve got OF compiled through XCode for i386 using XCode4, maybe I should be doing this through command line/makefile as well?

Here is what my makefile looks like, it should be pretty simple to read since I copied/rewrote the Git makefile to target OS X only (again, for sanity…too many uname refs and ifeq…ifneq things were making my brain hurt between linux, android and OS X). It compiles main.cpp and testApp.cpp fine, but there is an issue with the linking that I just can’t figure out.

Thanks to anyone that can help and thanks to Arturo for previous help and creating super good/clear makefiles that I was already able to jump into without knowing anything.

Makefile:

  
# openFrameworks OS X makefile  
#  
# make help : shows this message  
# make Debug:  makes the application with debug symbols  
# make Release: makes the app with optimizations  
# make: the same as make Release  
# make CleanDebug: cleans the Debug target  
# make CleanRelease: cleans the Release target  
# make clean: cleans everything  
#  
#  
# this should work with any OF app, just copy any example  
# change the name of the folder and it should compile  
# only .cpp support, don't use .c files  
# it will look for files in any folder inside the application  
# folder except that in the EXCLUDE_FROM_SOURCE variable  
# it doesn't autodetect include paths yet  
# add the include paths in the USER_CFLAGS variable  
# using the gcc syntax: -Ipath  
#  
# to add addons to your application, edit the addons.make file  
# in this directory and add the names of the addons you want to  
# include  
#  
# edit the following  vars to customize the makefile  
  
include config.make  
ARCH = i386  
  
COMPILER_OPTIMIZATION = $(USER_COMPILER_OPTIMIZATION)  
  
EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj"  
  
  
# you shouldn't modify anything below this line  
SHELL =  /bin/sh  
CXX =  LLVM-gcc  
LIBSPATH=osx  
  
NODEPS = clean  
SED_EXCLUDE_FROM_SRC = $(shell echo  $(EXCLUDE_FROM_SOURCE) | sed s/\,/\\\\\|/g)  
SOURCE_DIRS = $(shell find . -maxdepth 1 -mindepth 1 -type d | grep -v $(SED_EXCLUDE_FROM_SRC) | sed s/.\\///)  
SOURCES = $(shell find $(SOURCE_DIRS) -name "*.cpp" -or -name "*.c")  
OBJFILES = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))  
APPNAME = $(shell basename `pwd`)  
CORE_INCLUDES = $(shell find $(OF_ROOT)/libs/openFrameworks/ -type d)  
CORE_INCLUDE_FLAGS = $(addprefix -I,$(CORE_INCLUDES))  
INCLUDES = $(shell find $(OF_ROOT)/libs/*/include -type d | grep -v glu | grep -v quicktime | grep -v poco)  
INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))  
INCLUDES_FLAGS += -I$(OF_ROOT)/libs/poco/include  
INCLUDES_FLAGS += -I$(OF_ROOT)/libs/glu/include  
  
LIB_STATIC = $(shell ls $(OF_ROOT)/libs/*/lib/$(LIBSPATH)/*.a | grep -v openFrameworksCompiled | grep -v poco | sed "s/.*\\/lib\([^/]*\)\.a/-l\1/")  
LIB_SHARED = $(shell ls $(OF_ROOT)/libs/*/lib/$(LIBSPATH)/*.so | grep -v openFrameworksCompiled| sed "s/.*\\/lib\([^/]*\)\.so/-l\1/")  
LIB_STATIC += $(OF_ROOT)/libs/poco/lib/$(LIBSPATH)/PocoNet.a ../../../libs/poco/lib/$(LIBSPATH)/PocoXML.a ../../../libs/poco/lib/$(LIBSPATH)/PocoUtil.a ../../../libs/poco/lib/$(LIBSPATH)/PocoFoundation.a  
LIB_PATHS_FLAGS = $(shell ls -d $(OF_ROOT)/libs/*/lib/$(LIBSPATH) | sed "s/\(\.*\)/-L\1/")  
  
CFLAGS += -Wall -fexceptions  
CFLAGS += -I.  
CFLAGS += $(INCLUDES_FLAGS)  
CFLAGS += $(CORE_INCLUDE_FLAGS)  
  
LIBS += $(LIB_SHARED)  
LIBS += $(LIB_STATIC)  
  
LDFLAGS = $(LIB_PATHS_FLAGS) -Wl  
#LIBS += -lglut -lGL -lGLU -lasound -lopenal -lsndfile -lvorbis -lFLAC -logg -lfreeimage  
LIBS += -framework AppKit -framework Cocoa -framework IOKit -framework AGL -framework AudioToolbox -framework Carbon -framework CoreAudio -CoreFoundation -framework CoreServices -framework OpenGL -framework Quicktime  
  
#Targets  
ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)  
	TARGET_CFLAGS = -g  
	TARGET_LIBS = -lopenFrameworksDebug  
	TARGET_NAME = Debug  
endif  
  
ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)  
	TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)  
	TARGET_LIBS = -lopenFrameworks  
	TARGET_NAME = Release  
endif  
  
ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)  
    BIN_NAME = $(APPNAME)_debug  
	TARGET = bin/$(BIN_NAME)  
endif  
  
ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)  
    BIN_NAME = $(APPNAME)  
	TARGET = bin/$(BIN_NAME)  
endif  
  
ifeq ($(MAKECMDGOALS),)  
	TARGET_NAME = Release  
    BIN_NAME = $(APPNAME)  
	TARGET = bin/$(BIN_NAME)  
	TARGET_LIBS = -lopenFrameworks  
endif  
  
ifeq ($(MAKECMDGOALS),clean)  
	TARGET = bin/$(APPNAME)_debug bin/$(APPNAME)  
endif  
  
  
#Output  
OBJ_OUTPUT = obj/$(TARGET_NAME)/  
CLEANTARGET = clean$(TARGET_NAME)  
OBJS = $(addprefix $(OBJ_OUTPUT), $(OBJFILES))  
DEPFILES = $(patsubst %.o,%.d,$(OBJS))  
ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)  
	ADDONS_OBJS = $(addprefix $(OBJ_OUTPUT), $(ADDONS_OBJFILES))  
    DEPFILES += $(patsubst %.o,%.d,$(ADDONS_OBJS))  
endif  
  
.PHONY: Debug Release all after  
  
Release: $(TARGET) after  
  
Debug: $(TARGET) after  
  
all:  
	$(MAKE) Release  
	  
  
  
#This rule does the compilation  
#$(OBJS): $(SOURCES)  
$(OBJ_OUTPUT)%.o: %.cpp  
	@echo "compiling object for: " $<  
	mkdir -p $(@D)  
	$(CXX) -c $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $<  
  
$(OBJ_OUTPUT)%.o: %.c  
	@echo "compiling object for: " $<  
	mkdir -p $(@D)  
	$(CXX) -c $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $<  
  
  
$(OBJ_OUTPUT)%.o: $(OF_ROOT)/%.cpp  
	@echo "compiling addon object for" $<  
	mkdir -p $(@D)  
	$(CXX) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<  
  
$(OBJ_OUTPUT)%.o: $(OF_ROOT)/%.c  
	@echo "compiling addon object for" $<  
	mkdir -p $(@D)  
	$(CXX) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<  
  
$(TARGET): $(OBJS) $(ADDONS_OBJS)  
	@echo "linking" $(TARGET) $(GTK)  
	$(CXX) -arch i386 -Wl,-v -o $@ $(OBJS) $(ADDONS_OBJS) $(USER_CFLAGS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(ADDONSLIBS) $(USER_LIBS) $(LIBS)  
  
-include $(DEPFILES)  
  
.PHONY: clean cleanDebug cleanRelease  
clean:  
	rm -Rf obj  
	rm -f -v $(TARGET)  
	rm -Rf -v bin/libs  
  
$(CLEANTARGET):  
	rm -Rf -v $(OBJ_OUTPUT)  
	rm -f -v $(TARGET)  
  
after:$(TARGET)  
	cp -r $(OF_ROOT)/export/$(LIBSPATH)/libs bin/  
	@echo  
	@echo "     compiling done"  
	@echo "     to launch the application"  
	@echo  
	@echo "     cd bin"  
	@echo "     ./$(BIN_NAME)"  
	@echo  
  
  
.PHONY: help  
help:  
	@echo  
	@echo openFrameworks universal makefile  
	@echo  
	@echo targets:  
	@echo "make Debug:		builds the application with debug symbols"  
	@echo "make Release:		builds the app with optimizations"  
	@echo "make:			= make Release"  
	@echo "make all:		= make Release"  
	@echo "make CleanDebug:	cleans the Debug target"  
	@echo "make CleanRelease:	cleans the Release target"  
	@echo "make clean:		cleans everything"  
	@echo  
	@echo this should work with any OF app, just copy any example  
	@echo change the name of the folder and it should compile  
	@echo "only .cpp support, don't use .c files"  
	@echo it will look for files in any folder inside the application  
	@echo folder except that in the EXCLUDE_FROM_SOURCE variable.  
	@echo "it doesn't autodetect include paths yet"  
	@echo "add the include paths editing the var USER_CFLAGS"  
	@echo at the beginning of the makefile using the gcc syntax:  
	@echo -Ipath  
	@echo  
	@echo to add addons to your application, edit the addons.make file  
	@echo in this directory and add the names of the addons you want to  
	@echo include  
	@echo  
  

Errors (using LLVM-gcc), .o files are created without any errors, this is from linking:

  
  
linking bin/graphicsExample_debug  
LLVM-gcc -arch i386 -Wl,-v -o bin/graphicsExample_debug obj/Debug/src/main.o obj/Debug/src/testApp.o  -arch i386 -L../../../libs/FreeImage/lib/osx -L../../../libs/fmodex/lib/osx -L../../../libs/freetype/lib/osx -L../../../libs/glee/lib/osx -L../../../libs/glut/lib/osx -L../../../libs/openFrameworksCompiled/lib/osx -L../../../libs/poco/lib/osx -L../../../libs/rtAudio/lib/osx -Wl  -L../../../libs/openFrameworksCompiled/lib/osx/openFrameworksDebug    ../../../libs/FreeImage/lib/osx/freeimage.a ../../../libs/freetype/lib/osx/freetype.a ../../../libs/glee/lib/osx/GLee.a ../../../libs/rtAudio/lib/osx/rtAudio.a ../../../libs/poco/lib/osx/PocoNet.a ../../../libs/poco/lib/osx/PocoXML.a ../../../libs/poco/lib/osx/PocoUtil.a ../../../libs/poco/lib/osx/PocoFoundation.a -framework AppKit -framework Cocoa -framework IOKit -framework AGL -framework AudioToolbox -framework Carbon -framework CoreAudio -CoreFoundation -framework CoreServices -framework OpenGL -framework Quicktime  
collect2 version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.9) (i686 Darwin)  
/usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/ld -dynamic -arch i386 -macosx_version_min 10.6.7 -weak_reference_mismatches non-weak -o bin/graphicsExample_debug -lcrt1.10.6.o -L../../../libs/FreeImage/lib/osx -L../../../libs/fmodex/lib/osx -L../../../libs/freetype/lib/osx -L../../../libs/glee/lib/osx -L../../../libs/glut/lib/osx -L../../../libs/openFrameworksCompiled/lib/osx -L../../../libs/poco/lib/osx -L../../../libs/rtAudio/lib/osx -L../../../libs/openFrameworksCompiled/lib/osx/openFrameworksDebug -L/usr/lib/i686-apple-darwin10/4.2.1 -L/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/llvm-gcc-4.2/bin/../lib/gcc -L/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/../../.. -L/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin10/4.2.1/../../.. -v obj/Debug/src/main.o obj/Debug/src/testApp.o ../../../libs/FreeImage/lib/osx/freeimage.a ../../../libs/freetype/lib/osx/freetype.a ../../../libs/glee/lib/osx/GLee.a ../../../libs/rtAudio/lib/osx/rtAudio.a ../../../libs/poco/lib/osx/PocoNet.a ../../../libs/poco/lib/osx/PocoXML.a ../../../libs/poco/lib/osx/PocoUtil.a ../../../libs/poco/lib/osx/PocoFoundation.a -framework AppKit -framework Cocoa -framework IOKit -framework AGL -framework AudioToolbox -framework Carbon -framework CoreAudio -framework CoreServices -framework OpenGL -framework Quicktime -lSystem -lgcc -lSystem  
ld: warning: directory not found for option '-L../../../libs/openFrameworksCompiled/lib/osx/openFrameworksDebug'  
@(#)PROGRAM:ld  PROJECT:ld64-123.2  
Library search paths:  
	../../../libs/FreeImage/lib/osx  
	../../../libs/fmodex/lib/osx  
	../../../libs/freetype/lib/osx  
	../../../libs/glee/lib/osx  
	../../../libs/glut/lib/osx  
	../../../libs/openFrameworksCompiled/lib/osx  
	../../../libs/poco/lib/osx  
	../../../libs/rtAudio/lib/osx  
	/usr/lib/i686-apple-darwin10/4.2.1  
	/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin10/4.2.1  
	/usr/llvm-gcc-4.2/lib/gcc  
	/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin10/4.2.1  
	/usr/lib/gcc/i686-apple-darwin10/4.2.1  
	/usr/llvm-gcc-4.2/lib  
	/Developer/usr/llvm-gcc-4.2/lib  
	/usr/lib  
	/usr/local/lib  
Framework search paths:  
	/Library/Frameworks/  
	/System/Library/Frameworks/  
Undefined symbols for architecture i386:  
  "ofAppGlutWindow::ofAppGlutWindow()", referenced from:  
      _main in main.o  
  "ofSetupOpenGL(ofAppBaseWindow*, int, int, int)", referenced from:  
      _main in main.o  
  "operator new(unsigned long)", referenced from:  
      _main in main.o  
  "ofRunApp(ofBaseApp*)", referenced from:  
      _main in main.o  
  "std::terminate()", referenced from:  
      _main in main.o  
      testApp::setup()     in testApp.o  
      testApp::draw()     in testApp.o  
  "operator delete(void*)", referenced from:  
      ofBaseApp::~ofBaseApp()in main.o  
      ofBaseApp::~ofBaseApp()in main.o  
      ofAppGlutWindow::~ofAppGlutWindow()in main.o  
      testApp::~testApp()in testApp.o  
      testApp::~testApp()in testApp.o  
  "std::ios_base::Init::Init()", referenced from:  
      __static_initialization_and_destruction_0(int, int)in main.o  
      __static_initialization_and_destruction_0(int, int)in testApp.o  
  "std::ios_base::Init::~Init()", referenced from:  
      ___tcf_0 in main.o  
      ___tcf_0 in testApp.o  
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()", referenced from:  
      ofAppGlutWindow::~ofAppGlutWindow()in main.o  
      testApp::setup()     in testApp.o  
      testApp::draw()     in testApp.o  
  "vtable for __cxxabiv1::__class_type_info", referenced from:  
      typeinfo for ofBaseAppin main.o  
      typeinfo for ofBaseAppin testApp.o  
  "vtable for ofAppGlutWindow", referenced from:  
      ofAppGlutWindow::~ofAppGlutWindow()in main.o  
  "___gxx_personality_v0", referenced from:  
      Dwarf Exception Unwind Info (__eh_frame) in main.o  
      Dwarf Exception Unwind Info (__eh_frame) in testApp.o  
      Dwarf Exception Unwind Info (__eh_frame) in main.o  
      Dwarf Exception Unwind Info (__eh_frame) in testApp.o  
  "ofSetCircleResolution(int)", referenced from:  
      testApp::setup()     in testApp.o  
  "ofBackground(int, int, int)", referenced from:  
      testApp::setup()     in testApp.o  
  "std::allocator<char>::allocator()", referenced from:  
      testApp::setup()     in testApp.o  
      testApp::draw()     in testApp.o  
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:  
      testApp::setup()     in testApp.o  
      testApp::draw()     in testApp.o  
  "ofSetWindowTitle(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)", referenced from:  
      testApp::setup()     in testApp.o  
  "std::allocator<char>::~allocator()", referenced from:  
      testApp::setup()     in testApp.o  
      testApp::draw()     in testApp.o  
  "ofSetFrameRate(int)", referenced from:  
      testApp::setup()     in testApp.o  
  "std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:  
      testApp::setup()     in testApp.o  
  "std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))", referenced from:  
      testApp::setup()     in testApp.o  
  "ofSetColor(int, int, int)", referenced from:  
      testApp::draw()     in testApp.o  
  "ofFill()", referenced from:  
      testApp::draw()     in testApp.o  
  "ofCircle(float, float, float)", referenced from:  
      testApp::draw()     in testApp.o  
  "ofNoFill()", referenced from:  
      testApp::draw()     in testApp.o  
  "ofSetColor(int)", referenced from:  
      testApp::draw()     in testApp.o  
  "ofDrawBitmapString(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, float, float)", referenced from:  
      testApp::draw()     in testApp.o  
  "ofRandom(float, float)", referenced from:  
      testApp::draw()     in testApp.o  
  "ofRect(float, float, float, float)", referenced from:  
      testApp::draw()     in testApp.o  
  "ofEnableAlphaBlending()", referenced from:  
      testApp::draw()     in testApp.o  
  "ofSetColor(int, int, int, int)", referenced from:  
      testApp::draw()     in testApp.o  
  "ofDisableAlphaBlending()", referenced from:  
      testApp::draw()     in testApp.o  
  "ofEnableSmoothing()", referenced from:  
      testApp::draw()     in testApp.o  
  "ofLine(float, float, float, float)", referenced from:  
      testApp::draw()     in testApp.o  
  "ofDisableSmoothing()", referenced from:  
      testApp::draw()     in testApp.o  
  "vtable for __cxxabiv1::__si_class_type_info", referenced from:  
      typeinfo for testAppin testApp.o  
  "std::cout", referenced from:  
      testApp::setup()     in testApp.o  
  "std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)", referenced from:  
      testApp::setup()     in testApp.o  
ld: symbol(s) not found for architecture i386  
collect2: ld returned 1 exit status  
make: *** [bin/graphicsExample_debug] Error 1  
  

try changing this line

  
LIB_STATIC = $(shell ls $(OF_ROOT)/libs/*/lib/$(LIBSPATH)/*.a | grep -v openFrameworksCompiled | grep -v poco | sed "s/.*\\/lib\([^/]*\)\.a/-l\1/")   

to:

  
LIB_STATIC = $(shell ls $(OF_ROOT)/libs/*/lib/$(LIBSPATH)/*.a | grep -v openFrameworksCompiled | grep -v poco)   

and then change all lines like:

  
TARGET_LIBS = -lopenFrameworks   

to

  
TARGET_LIBS = -../../../libs/openFrameworksCompiled/lib/osx/openFrameworks.a   

or whatever the correct path to the library is

Thanks again Arturo…got it working! The linking changes helped, the only thing wrong was the “-” in front, removing that linked OF properly…also had to add in refs to FMOD since it is a .dylib file, and then I removed the stuff copying libs from /export/ and added stuff to copy over FMOD .dylib files into bin/. Also, for some reason I change G++ to GCC which was throwing the C++ errors, changing that back solved any linker issues I had with STD libraries.

Now on to WebOS…

For anyone interested, here is a (basic) os x makefile for 0.62 w/o addons…you’ll also need config.make to have the following in it:
USER_CFLAGS = -arch i386

Because Quicktime framework hasn’t been upgraded to 64 bit for some reason.

  
  
# openFrameworks OS X makefile  
#  
# make help : shows this message  
# make Debug:  makes the application with debug symbols  
# make Release: makes the app with optimizations  
# make: the same as make Release  
# make CleanDebug: cleans the Debug target  
# make CleanRelease: cleans the Release target  
# make clean: cleans everything  
#  
#  
# this should work with any OF app, just copy any example  
# change the name of the folder and it should compile  
# only .cpp support, don't use .c files  
# it will look for files in any folder inside the application  
# folder except that in the EXCLUDE_FROM_SOURCE variable  
# it doesn't autodetect include paths yet  
# add the include paths in the USER_CFLAGS variable  
# using the gcc syntax: -Ipath  
#  
# to add addons to your application, edit the addons.make file  
# in this directory and add the names of the addons you want to  
# include  
#  
# edit the following  vars to customize the makefile  
  
include config.make  
ARCH = i386  
  
COMPILER_OPTIMIZATION = $(USER_COMPILER_OPTIMIZATION)  
  
EXCLUDE_FROM_SOURCE="bin,.xcodeproj,obj"  
  
  
# you shouldn't modify anything below this line  
SHELL =  /bin/sh  
CXX =  g++  
LIBSPATH=osx  
  
NODEPS = clean  
SED_EXCLUDE_FROM_SRC = $(shell echo  $(EXCLUDE_FROM_SOURCE) | sed s/\,/\\\\\|/g)  
SOURCE_DIRS = $(shell find . -maxdepth 1 -mindepth 1 -type d | grep -v $(SED_EXCLUDE_FROM_SRC) | sed s/.\\///)  
SOURCES = $(shell find $(SOURCE_DIRS) -name "*.cpp" -or -name "*.c")  
OBJFILES = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))  
APPNAME = $(shell basename `pwd`)  
CORE_INCLUDES = $(shell find $(OF_ROOT)/libs/openFrameworks/ -type d)  
CORE_INCLUDE_FLAGS = $(addprefix -I,$(CORE_INCLUDES))  
INCLUDES = $(shell find $(OF_ROOT)/libs/*/include -type d | grep -v glu | grep -v quicktime | grep -v poco)  
INCLUDES_FLAGS = $(addprefix -I,$(INCLUDES))  
INCLUDES_FLAGS += -I$(OF_ROOT)/libs/poco/include  
INCLUDES_FLAGS += -I$(OF_ROOT)/libs/glu/include  
  
LIB_STATIC = $(shell ls $(OF_ROOT)/libs/*/lib/$(LIBSPATH)/*.a | grep -v openFrameworksCompiled | grep -v poco)  
LIB_STATIC += ../../../libs/fmodex/lib/osx/libfmodex.dylib  
LIB_SHARED = $(shell ls $(OF_ROOT)/libs/*/lib/$(LIBSPATH)/*.so | grep -v openFrameworksCompiled | grep -v poco)  
LIB_STATIC += $(OF_ROOT)/libs/poco/lib/$(LIBSPATH)/PocoNet.a ../../../libs/poco/lib/$(LIBSPATH)/PocoXML.a ../../../libs/poco/lib/$(LIBSPATH)/PocoUtil.a ../../../libs/poco/lib/$(LIBSPATH)/PocoFoundation.a  
LIB_PATHS_FLAGS = $(shell ls -d $(OF_ROOT)/libs/*/lib/$(LIBSPATH) | sed "s/\(\.*\)/-L\1/")  
  
CFLAGS += -Wall -fexceptions  
CFLAGS += -I.  
CFLAGS += $(INCLUDES_FLAGS)  
CFLAGS += $(CORE_INCLUDE_FLAGS)  
  
LIBS += $(LIB_SHARED)  
LIBS += $(LIB_STATIC)  
  
LDFLAGS = $(LIB_PATHS_FLAGS) -Wl  
LIBS += -framework AppKit -framework Cocoa -framework IOKit -framework AGL -framework AudioToolbox -framework Carbon -framework CoreAudio -CoreFoundation -framework CoreServices -framework GLUT -framework OpenGL -framework Quicktime  
  
#Targets  
ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)  
	TARGET_CFLAGS = -g  
	TARGET_LIBS = ../../../libs/openFrameworksCompiled/lib/osx/openFrameworksDebug.a  
	TARGET_NAME = Debug  
endif  
  
ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)  
	TARGET_CFLAGS = $(COMPILER_OPTIMIZATION)  
	TARGET_LIBS = ../../../libs/openFrameworksCompiled/lib/osx/openFrameworks.a  
	TARGET_NAME = Release  
endif  
  
ifeq ($(findstring Debug,$(MAKECMDGOALS)),Debug)  
    BIN_NAME = $(APPNAME)_debug  
	TARGET = bin/$(BIN_NAME)  
endif  
  
ifeq ($(findstring Release,$(MAKECMDGOALS)),Release)  
    BIN_NAME = $(APPNAME)  
	TARGET = bin/$(BIN_NAME)  
endif  
  
ifeq ($(MAKECMDGOALS),)  
	TARGET_NAME = Release  
    BIN_NAME = $(APPNAME)  
	TARGET = bin/$(BIN_NAME)  
	TARGET_LIBS = ../../../libs/openFrameworksCompiled/lib/osx/openFrameworks.a  
endif  
  
ifeq ($(MAKECMDGOALS),clean)  
	TARGET = bin/$(APPNAME)_debug bin/$(APPNAME)  
endif  
  
  
#Output  
OBJ_OUTPUT = obj/$(TARGET_NAME)/  
CLEANTARGET = clean$(TARGET_NAME)  
OBJS = $(addprefix $(OBJ_OUTPUT), $(OBJFILES))  
DEPFILES = $(patsubst %.o,%.d,$(OBJS))  
ifeq ($(findstring addons.make,$(wildcard *.make)),addons.make)  
	ADDONS_OBJS = $(addprefix $(OBJ_OUTPUT), $(ADDONS_OBJFILES))  
    DEPFILES += $(patsubst %.o,%.d,$(ADDONS_OBJS))  
endif  
  
.PHONY: Debug Release all after  
  
Release: $(TARGET) after  
  
Debug: $(TARGET) after  
  
all:  
	$(MAKE) Release  
	  
  
  
#This rule does the compilation  
#$(OBJS): $(SOURCES)  
$(OBJ_OUTPUT)%.o: %.cpp  
	@echo "compiling object for: " $<  
	mkdir -p $(@D)  
	$(CXX) -c $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $<  
  
$(OBJ_OUTPUT)%.o: %.c  
	@echo "compiling object for: " $<  
	mkdir -p $(@D)  
	$(CXX) -c $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o$@ -c $<  
  
  
$(OBJ_OUTPUT)%.o: $(OF_ROOT)/%.cpp  
	@echo "compiling addon object for" $<  
	mkdir -p $(@D)  
	$(CXX) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<  
  
$(OBJ_OUTPUT)%.o: $(OF_ROOT)/%.c  
	@echo "compiling addon object for" $<  
	mkdir -p $(@D)  
	$(CXX) $(TARGET_CFLAGS) $(CFLAGS) $(ADDONSCFLAGS) $(USER_CFLAGS) -MMD -MP -MF$(OBJ_OUTPUT)$*.d -MT$(OBJ_OUTPUT)$*.d -o $@ -c $<  
  
$(TARGET): $(OBJS) $(ADDONS_OBJS)  
	@echo "linking" $(TARGET) $(GTK)  
	$(CXX) -v -o $@ $(OBJS) $(ADDONS_OBJS) $(USER_CFLAGS) $(LDFLAGS) $(USER_LDFLAGS) $(TARGET_LIBS) $(ADDONSLIBS) $(USER_LIBS) $(LIBS)  
  
-include $(DEPFILES)  
  
.PHONY: clean cleanDebug cleanRelease  
clean:  
	rm -Rf obj  
	rm -f -v $(TARGET)  
	rm -Rf -v bin/libs  
  
$(CLEANTARGET):  
	rm -Rf -v $(OBJ_OUTPUT)  
	rm -f -v $(TARGET)  
  
after:$(TARGET)  
	@echo Copying over FMOD libs for OS X  
	cp -r $(OF_ROOT)/libs/fmodex/lib/osx/* bin/  
	@echo  
	@echo "     compiling done"  
	@echo "     to launch the application"  
	@echo  
	@echo "     cd bin"  
	@echo "     ./$(BIN_NAME)"  
	@echo  
  
  
.PHONY: help  
help:  
	@echo  
	@echo openFrameworks universal makefile  
	@echo  
	@echo targets:  
	@echo "make Debug:		builds the application with debug symbols"  
	@echo "make Release:		builds the app with optimizations"  
	@echo "make:			= make Release"  
	@echo "make all:		= make Release"  
	@echo "make CleanDebug:	cleans the Debug target"  
	@echo "make CleanRelease:	cleans the Release target"  
	@echo "make clean:		cleans everything"  
	@echo  
	@echo this should work with any OF app, just copy any example  
	@echo change the name of the folder and it should compile  
	@echo "only .cpp support, don't use .c files"  
	@echo it will look for files in any folder inside the application  
	@echo folder except that in the EXCLUDE_FROM_SOURCE variable.  
	@echo "it doesn't autodetect include paths yet"  
	@echo "add the include paths editing the var USER_CFLAGS"  
	@echo at the beginning of the makefile using the gcc syntax:  
	@echo -Ipath  
	@echo  
	@echo to add addons to your application, edit the addons.make file  
	@echo in this directory and add the names of the addons you want to  
	@echo include  
	@echo  
  

hey great!

yes gcc is the c compiler, g++ the c++ one that’s why you were getting errors on std stuff.