-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
83 lines (62 loc) · 2.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# Copyright 2009 Anthony Stone and Aleksandar Donev
# This file is part of f03gl.
#
# f03gl is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# f03gl is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with f03gl (see file COPYING). If not, see
# <http://www.gnu.org/licenses/>.
# Comment out for 32-bit architecture
BITS := 64
# The directories containing the OpenGL libraries and GLUT libraries
# OGLLIBDIR := -L/usr/lib/x86_64-linux-gnu
# OGLLIBDIR := -L/usr/lib${BITS}
# The directory containing the X11 libraries
# X11LIBDIR := -L/usr/X11R6/lib${BITS}
X11LIBDIR := -L/usr/lib/x86_64-linux-gnu
# Libraries for OpenGL, including GLUT, GLU and OpenGL
#F90GLUTLIB := -lfreeglut -lGL -lGLU
# The X11 libraries
X11LIB := -lX11 -lm
ifndef COMPILER
COMPILER := gfortran
endif
FC=${COMPILER}
# Gfortran
FFLAGS := $(DEBUG) -fno-range-check -DOPENGL
LIBRARIES := ${OGLLIBDIR} ${X11LIBDIR}
ifeq (${COMPILER},gfortran)
LIBS := -lglut -lGL -lGLU ${X11LIB} -lpthread -ldl -lgfortran
FONTS := GLUT_fonts.o
else
LIBS := -lfreeglut -lGL -lGLU ${X11LIB} -lpthread -ldl -lgfortran
endif
# Choose the appropriate definition of the GLUT variable to choose
# GLUT, OpenGLUT or FreeGlut. It may be necessary to adjust the libraries.
# GLUT := openglut
GLUT := freeglut
# GLUT := glut
VPATH=gl
LIBRARIES := ${OGLLIBDIR} ${X11LIBDIR} -L/usr/local/lib
MODULES = ${FONTS} OpenGL_gl.o OpenGL_${GLUT}.o OpenGL_glu.o perlin.o quads.o worlds.o players.o
all: fortranBird
OpenGL_${GLUT}.o: OpenGL_gl.o
%.o: %.F90
${FC} ${FFLAGS} -O3 -c $<
fortranBird : %: %.F90 ${MODULES} force
${FC} ${FFLAGS} -O3 -c $<
${FC} [email protected] ${MODULES} ${LIBRARIES} ${LIBS} -o $@
OpenGL%.mod: OpenGL%.F90
${FC} ${FFLAGS} -O3 -c $<
force:
OpenGL_${GLUT}.o OpenGL_glu.o: OpenGL_gl.o
clean:
-rm -f *.mod *.o fortranBird