167 lines
5.3 KiB
Makefile
167 lines
5.3 KiB
Makefile
|
##########################################################################
|
||
|
# Makefile for GLFW on Mac OS X using GCC (Apple SDK).
|
||
|
#-------------------------------------------------------------------------
|
||
|
# To compile GLFW using this makefile, run:
|
||
|
# make -f Makefile.macosx.gcc
|
||
|
##########################################################################
|
||
|
|
||
|
##########################################################################
|
||
|
# Installation prefix (default to /usr/local)
|
||
|
##########################################################################
|
||
|
PREFIX ?= /usr/local
|
||
|
|
||
|
|
||
|
##########################################################################
|
||
|
# Default: Build GLFW static library
|
||
|
##########################################################################
|
||
|
default: libglfw.a
|
||
|
|
||
|
|
||
|
##########################################################################
|
||
|
# Compiler settings
|
||
|
##########################################################################
|
||
|
CC = gcc
|
||
|
FATFLAGS = -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386
|
||
|
CFLAGS = -c -I. -I.. -Wall -Os -fno-common $(FATFLAGS)
|
||
|
|
||
|
# Some modules should be optimized for speed (e.g. image decoding)
|
||
|
CFLAGS_SPEED = -c -I. -I.. -Wall -O3 -ffast-math -fno-common $(FATFLAGS)
|
||
|
|
||
|
|
||
|
##########################################################################
|
||
|
# Library builder settings
|
||
|
##########################################################################
|
||
|
# Static library
|
||
|
SED = sed
|
||
|
INSTALL = install
|
||
|
MKLIB = ar
|
||
|
LIBFLAGS = -rcs
|
||
|
RANLIB = ranlib
|
||
|
|
||
|
|
||
|
##########################################################################
|
||
|
# Install GLFW header and static library
|
||
|
##########################################################################
|
||
|
install: libglfw.a libglfw.pc
|
||
|
$(INSTALL) -d $(PREFIX)/lib
|
||
|
$(INSTALL) -c -m 644 libglfw.a $(PREFIX)/lib/libglfw.a
|
||
|
$(RANLIB) $(PREFIX)/lib/libglfw.a
|
||
|
$(INSTALL) -d $(PREFIX)/include/GL
|
||
|
$(INSTALL) -c -m 644 ../../include/GL/glfw.h $(PREFIX)/include/GL/glfw.h
|
||
|
$(INSTALL) -d $(PREFIX)/lib/pkgconfig
|
||
|
$(INSTALL) -c -m 644 libglfw.pc $(PREFIX)/lib/pkgconfig/libglfw.pc
|
||
|
|
||
|
|
||
|
##########################################################################
|
||
|
# Rule for cleaning up generated files
|
||
|
##########################################################################
|
||
|
clean:
|
||
|
@rm -f *.o libglfw.a libglfw.pc
|
||
|
|
||
|
|
||
|
##########################################################################
|
||
|
# Object files which are part of the GLFW library
|
||
|
##########################################################################
|
||
|
OBJS = \
|
||
|
enable.o \
|
||
|
fullscreen.o \
|
||
|
glext.o \
|
||
|
image.o \
|
||
|
init.o \
|
||
|
input.o \
|
||
|
joystick.o \
|
||
|
stream.o \
|
||
|
tga.o \
|
||
|
thread.o \
|
||
|
time.o \
|
||
|
window.o \
|
||
|
macosx_enable.o \
|
||
|
macosx_fullscreen.o \
|
||
|
macosx_glext.o \
|
||
|
macosx_init.o \
|
||
|
macosx_joystick.o \
|
||
|
macosx_thread.o \
|
||
|
macosx_time.o \
|
||
|
macosx_window.o
|
||
|
|
||
|
|
||
|
##########################################################################
|
||
|
# Rule for building libglfw.pc
|
||
|
##########################################################################
|
||
|
libglfw.pc: libglfw.pc.in
|
||
|
$(SED) -e 's,\@PREFIX\@,$(PREFIX),' libglfw.pc.in > libglfw.pc
|
||
|
|
||
|
|
||
|
##########################################################################
|
||
|
# Rule for building library
|
||
|
##########################################################################
|
||
|
libglfw.a: $(OBJS)
|
||
|
rm -f $@
|
||
|
$(MKLIB) $(LIBFLAGS) $@ $(OBJS)
|
||
|
$(RANLIB) $@
|
||
|
|
||
|
|
||
|
##########################################################################
|
||
|
# Rules for building library object files
|
||
|
##########################################################################
|
||
|
enable.o: ../enable.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ ../enable.c
|
||
|
|
||
|
fullscreen.o: ../fullscreen.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ ../fullscreen.c
|
||
|
|
||
|
glext.o: ../glext.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ ../glext.c
|
||
|
|
||
|
image.o: ../image.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS_SPEED) -o $@ ../image.c
|
||
|
|
||
|
init.o: ../init.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ ../init.c
|
||
|
|
||
|
input.o: ../input.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ ../input.c
|
||
|
|
||
|
joystick.o: ../joystick.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ ../joystick.c
|
||
|
|
||
|
stream.o: ../stream.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ ../stream.c
|
||
|
|
||
|
tga.o: ../tga.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS_SPEED) -o $@ ../tga.c
|
||
|
|
||
|
thread.o: ../thread.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ ../thread.c
|
||
|
|
||
|
time.o: ../time.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ ../time.c
|
||
|
|
||
|
window.o: ../window.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ ../window.c
|
||
|
|
||
|
macosx_enable.o: macosx_enable.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ macosx_enable.c
|
||
|
|
||
|
macosx_fullscreen.o: macosx_fullscreen.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ macosx_fullscreen.c
|
||
|
|
||
|
macosx_glext.o: macosx_glext.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ macosx_glext.c
|
||
|
|
||
|
macosx_init.o: macosx_init.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ macosx_init.c
|
||
|
|
||
|
macosx_joystick.o: macosx_joystick.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ macosx_joystick.c
|
||
|
|
||
|
macosx_thread.o: macosx_thread.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ macosx_thread.c
|
||
|
|
||
|
macosx_time.o: macosx_time.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ macosx_time.c
|
||
|
|
||
|
macosx_window.o: macosx_window.c ../internal.h platform.h
|
||
|
$(CC) $(CFLAGS) -o $@ macosx_window.c
|
||
|
|