Fork me on GitHub

source: svn/trunk/Utilities/FROG/Makefile@ 99

Last change on this file since 99 was 95, checked in by severine ovyn, 16 years ago

first commit frog

File size: 3.1 KB
Line 
1CXX = g++
2CXXFLAGS=-DFROG_OPENGL -DFROG_ZLIB -DFROG_LIGHTING
3CXXFLAGSOPTIM=-O3 -funroll-loops -s
4CXXFLAGS+=$(CXXFLAGSOPTIM)
5LDFLAGS=
6SOTYPE=
7SRCDIR = ../src
8INCDIR = Includes
9LIBDIR = $(shell if [ -n "$(FROGDIR)" ];then echo $(FROGDIR)/soft/Lib;else echo Lib;fi)
10RM = rm -f
11
12SHELL = /bin/sh
13
14ARCH=$(shell uname -a)
15
16OS=$(shell uname)
17
18ifeq (Darwin,$(findstring Darwin,$(OS)))
19OSDEPENDENT=-Dmacos
20FRAMEWORKS=-framework GLUT -lGL -lGLU -framework System
21SOTYPE=.dylib
22LDFLAGS=-g -prebind -dynamiclib
23
24ifeq (x86_64,$(findstring x86_64,$(ARCH)))
25ARCHDEPENDENT=-L$(LIBDIR) -L/usr/X11R6/lib64 -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
26else
27ARCHDEPENDENT=-L$(LIBDIR) -L/usr/X11R6/lib -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
28endif
29
30else
31OSDEPENDENT=-Dlinux
32SOTYPE=.so
33LDFLAGS=-shared -Wl,-soname,
34
35ifeq (x86_64,$(findstring x86_64,$(ARCH)))
36LIB=lib64
37ARCHDEPENDENT=-L$(LIBDIR) -lglut -L/usr/lib -L/usr/X11/lib64 -L/usr/X11R6/lib64 -lGLU -lGL
38else
39LIB=lib32
40ARCHDEPENDENT=-L$(LIBDIR) -lglut -L/usr/lib -lglut -L/usr/X11/lib -L/usr/X11R6/lib -lGLU -lGL
41endif
42
43endif
44
45
46OBJS = $(LIBDIR)/FROG_Light.o $(LIBDIR)/FROG_Primitives.o $(LIBDIR)/FROG_Geometry.o $(LIBDIR)/FROG_Events.o $(LIBDIR)/FROG_Texture.o $(LIBDIR)/FROG_ReadCards.o $(LIBDIR)/FROG_Camera.o $(LIBDIR)/FROG_Element_Tools.o $(LIBDIR)/FROG_Coord.o $(LIBDIR)/FROG_ZLib.o $(LIBDIR)/GL2PS.o $(LIBDIR)/GLEW.o
47
48all : main.cpp $(LIB) libfrog$(SOTYPE)
49 $(CXX) -Wall -o frog main.cpp $(CXXFLAGS) $(OSDEPENDENT) $(FRAMEWORKS) $(ARCHDEPENDENT) -lm -lX11 -lfrog -lpng -lz -lcurl -pthread
50
51$(LIBDIR)/%.o : $(SRCDIR)/%.cpp
52 $(CXX) -c $(CXXFLAGS) $(OSDEPENDENT) $< -fPIC -o $@
53
54$(LIBDIR)/%.o : $(INCDIR)/FROG/%.cpp
55 $(CXX) -c $(CXXFLAGS) $(OSDEPENDENT) $< -fPIC -o $@
56
57$(LIBDIR)/GL2PS.o : Includes/GL2PS/gl2ps.c
58 $(CXX) -c $(CXXFLAGS) $(OSDEPENDENT) $< -fPIC -o $@
59
60$(LIBDIR)/GLEW.o : Includes/GL/glew.c
61 $(CXX) -c $(CXXFLAGS) $(OSDEPENDENT) $< -fPIC -o $@
62
63lib64 :
64 @echo 'if [ ! -f $(LIBDIR)/libglut.so ];then ln -s /usr/lib64/libglut.so.3 $(LIBDIR)/libglut.so;fi'
65 @if [ ! -f $(LIBDIR)/libglut.so ];then ln -s /usr/lib64/libglut.so.3 $(LIBDIR)/libglut.so;fi
66 @echo 'if [ ! -f $(LIBDIR)/libpng.so ];then ln -s /usr/lib64/libpng.so.3 $(LIBDIR)/libpng.so;fi'
67 @if [ ! -f $(LIBDIR)/libpng.so ];then ln -s /usr/lib64/libpng.so.3 $(LIBDIR)/libpng.so;fi
68lib32 :
69 @echo 'if [ ! -f $(LIBDIR)/libglut.so ];then ln -s /usr/lib/libglut.so.3 $(LIBDIR)/libglut.so;fi'
70 @if [ ! -f $(LIBDIR)/libglut.so ];then ln -s /usr/lib/libglut.so.3 $(LIBDIR)/libglut.so;fi
71 @echo 'if [ ! -f $(LIBDIR)/libpng.so ];then ln -s /usr/lib/libpng.so.3 $(LIBDIR)/libpng.so;fi'
72 @if [ ! -f $(LIBDIR)/libpng.so ];then ln -s /usr/lib/libpng.so.3 $(LIBDIR)/libpng.so;fi
73
74libfrog.dylib : $(OBJS)
75 $(CXX) $(LDFLAGS) $(OBJS) $(CXXFLAGS) $(OSDEPENDENT) $(FRAMEWORKS) $(ARCHDEPENDENT) -lX11 -lz -lpng -o $(LIBDIR)/$@
76
77libfrog.so : $(OBJS)
78 $(CXX) $(LDFLAGS)$(LIBDIR)/$@ -o $(LIBDIR)/$@ $(OBJS) -lc
79
80clean :
81 $(RM) $(LIBDIR)/*.o $(LIBDIR)/*$(SOTYPE)
Note: See TracBrowser for help on using the repository browser.