Fork me on GitHub

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

Last change on this file since 554 was 554, checked in by Xavier Rouby, 15 years ago

bug in Makefile: now creates the 'Lib' directory if not existent

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