New Code Submission :)

Started by gregorypierce, January 20, 2005, 23:28:02

Previous topic - Next topic

gregorypierce

I fixed the Makefile and the build.xml file so that Mac users can build right out of the ant build file. This works with the current stuff in CVS and can probably be adapted to the stuff already in it.

<target name="-compile_native_mac" >
	
		<echo>Checking for valid OpenAL install</echo>
		<property name="openal.home" value="/projects/openal"/>
      	<available file="${openal.home}" type="dir" property="isValidOpenALHome"/>
 	  	<fail message="openal.home in build.xml in target compile_native_mac does not point to valid OpenAL install. Please change this to the location of your OpenAL install." unless="isValidOpenALHome"/>
		<echo>Valid OpenAL install located</echo>
		
		<echo>Compiling Mac OS X LWJGL version</echo>	
		<exec dir="${lwjgl.src.native}/macosx" executable="make" failonerror="true">
			<env key="AL" path="${openal.home}/include/AL/" />
		</exec>
	
		<move file="${lwjgl.src.native}/macosx/liblwjgl.jnilib" tofile="${lwjgl.lib}/liblwjgl.jnilib" />	
	
	</target>


In make file remove the first line with the hardcoded path. That is now injected as an environmental variable.

CC=gcc
LINKER=gcc
STRIP=strip
CFLAGS_LINK=-dynamiclib -Wall
FRAMEWORKS=-framework Foundation -framework AppKit -framework JavaVM -framework Carbon
CFLAGS_O=-fPIC -O2 -D_MACOSX -Wall -c -I${AL}/include -I../common -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
SRC=$(wildcard *.m) $(wildcard *.c) $(wildcard ../common/*.c) $(wildcard ../common/arb/*.c) $(wildcard ../common/ati/*.c) $(wildcard ../common/ext/*.c) $(wildcard ../common/nv/*.c)
OBJECTS=$(subst .m,.o, $(subst .c,.o,$(SRC)))
LIBRARY=liblwjgl.jnilib

$(LIBRARY): $(OBJECTS)
	$(LINKER) $(CFLAGS_LINK) -o $@ $(OBJECTS) $(FRAMEWORKS)
	$(STRIP) -S -X $@

.m.o:
	$(CC) $(CFLAGS_O) $< -o $@

.c.o:
	$(CC) $(CFLAGS_O) $< -o $@

clean:
	rm -f $(OBJECTS) $(LIBRARY)

Matzon

cool, can you confirm and commit this elias ?

elias

I'm not near my mac atm, but it looks all right. You can apply it ;)

- elias