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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
|
Description: build machinery: adjustment
Attempt to adjust the main Makefile for a better integration within
distribution machineries (e.g., debhelper(7)); meant to be suggested
to the upstream maintainer.
Origin: debian
Forwarded: by email
Author: Jerome Benoit <calculus@rezozer.net>
Last-Update: 2025-06-05
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,5 +1,5 @@
# Makefile for Surface Evolver
-SHELL= /bin/sh
+SHELL= /bin/bash
# INSTRUCTIONS: Customize this makefile for your system by choosing
# your compiler (cc or gcc or whatever), and then uncomment the
@@ -22,8 +22,8 @@
# be able to use geomview. And -DOOGL is harmless in any case.
# NOTE: You can use the readline input editing system (if your system has it)
-# by adding -DUSE_READLINE to CFLAGS and -lreadline -lcurses to GRAPHLIB.
-# But beware; readline may be incompatible with using geomview.
+# by adding -DUSE_READLINE to CFLAGS and -lreadline to GRAPHLIB.
+# But beware, readline may be incompatible with using geomview.
# Also, the readline code was contributed by a user for version 2.30,
# and may be incompatible with readline libraries on some systems (Mac,
# for instance).
@@ -34,13 +34,17 @@
# Can also add -DLONGDOUBLE to use the long double floating point datatype
# (but that is slower and not recommended for general use).
-CC= gcc -O3
+CC= gcc
+
+CFLAGS?=
+CFLAGS+= -O3
+#CFLAGS+= -DLONGDOUBLE
#---------------------Start of system choices---------------------------------
# Remove #'s from following 3 lines for generic Unix without builtin graphics.
# Add -DOOGL to CFLAGS if you are using geomview.
-#CFLAGS= -DGENERIC
+#CFLAGS+= -DGENERIC
#GRAPH= nulgraph.o
#GRAPHLIB=
@@ -51,7 +55,7 @@
# You might have to add something like -I/usr/X11R6/include to CFLAGS if
# there is a problem finding Xlib.h while compiling xgraph.c, and add
# -L/usr/X11R6/lib to GRAPHLIB.
-#CFLAGS= -DGENERIC
+#CFLAGS+= -DGENERIC
#GRAPH= xgraph.o
#GRAPHLIB= -lX11
#some places might have -lX11-mit
@@ -61,8 +65,8 @@
# Remove #'s from following 3 lines for LINUX with OpenGL GLUT graphics.
# The graphics are on a second thread, so pthreads are needed.
# NOTE: -DPTRHEADS is necessary with glutgraph.o.
-#CFLAGS= -DLINUX -DOOGL -DPTHREADS
-#GRAPH= glutgraph.o
+#CFLAGS+= -DLINUX -DOOGL -DPTHREADS
+#GRAPH= glutgraph.o
#GRAPHLIB= -lGL -lGLU -lglut -lpthread
# NOTE: It has been reported to me that RedHat 9 needs the following line
# for GRAPHLIB, but earlier and later versions do okay with the GRAPHLIB
@@ -72,25 +76,23 @@
#----- Linux OpenGL with __float128 and libquadmath --------------------------
# 128-bit floating point in software (but 10 times slower).
# It's up to you to install the quadmath library.
-# Remove #'s from following 3 lines for LINUX with OpenGL GLUT graphics.
-# The graphics are on a second thread, so pthreads are needed.
-# NOTE: -DPTRHEADS is necessary with glutgraph.o.
-#CFLAGS= -DLINUX -DOOGL -DPTHREADS -DFLOAT128
-#GRAPH= glutgraph.o
-#GRAPHLIB= -lGL -lGLU -lglut -lpthread /usr/lib64/libquadmath.so.0
+# Remove #'s from previous 3 lines for LINUX with OpenGL GLUT graphics and from
+# the following 2 lines for LINUX with 128-bit floating point computation.
+#CFLAGS+= -DFLOAT128
+#GRAPHLIB+= -lquadmath
#------ Linux Xwindows ------------------------------------------------------
# Remove #'s from following 3 lines for LINUX with crummy Xwindows graphics.
# You may have to modify the X11 lib path given here.
-#CFLAGS= -DLINUX -DOOGL
+#CFLAGS+= -DLINUX -DOOGL
#GRAPH= xgraph.o
#GRAPHLIB= -L/usr/X11R6/lib -lX11
#-------- cygwin --------------------------------------------------------------
# Remove #'s from the following three lines for cygwin.
-#CFLAGS= -DLINUX -DOOGL -DPTHREADS
+#CFLAGS+= -DLINUX -DOOGL -DPTHREADS
#GRAPH= glutgraph.o
#GRAPHLIB= -lglut -lglu32 -lopengl32 -lpthread
@@ -98,7 +100,7 @@
# Remove #'s from following 5 lines for MAC OSX with OpenGL GLUT graphics.
#INC=/System/Library/Frameworks/GLUT.framework/Versions/A/Headers
-#CFLAGS= -DLINUX -DPTHREADS -DOOGL -DMAC_OS_X -I$(INC)
+#CFLAGS+= -DLINUX -DPTHREADS -DOOGL -DMAC_OS_X -I$(INC)
#GRAPH= glutgraph.o
#GLDIR=/System/Library/Frameworks/OpenGL.framework/Libraries
#GRAPHLIB= -L$(GLDIR) -lGL -lGLU -lobjc -framework GLUT
@@ -111,7 +113,7 @@
# Remove #'s from following 3 lines for SUNs or SPARCSTATIONs with X-windows
# WARNING: If you use -O2 optimization, you may have to compile popfilm.c
# without optimization, because sun optimization may hang.
-#CFLAGS= -DSUN -DOOGL -I/usr/openwin/include
+#CFLAGS+= -DSUN -DOOGL -I/usr/openwin/include
#GRAPH= xgraph.o
#GRAPHLIB= -L/usr/openwin/lib -lX11
@@ -126,7 +128,7 @@
# download glut-3.7b.sparc_solaris.tar.gz from www.sun.com.
#GLUTHOME= /usr/local/sparc_solaris/glut-3.7
#INCLUDE= -I/usr/openwin/include -I$(GLUTHOME)/include
-#CFLAGS= -DSUN -DOOGL -DGLUT -DPTHREADS -mt $(INCLUDE)
+#CFLAGS+= -DSUN -DOOGL -DGLUT -DPTHREADS -mt $(INCLUDE)
#GRAPH= glutgraph.o
#GRAPHLIB= -L/usr/openwin/lib -lX11 -L$(GLUTHOME)/lib/glut -lglut -lGL -lGLU -lXmu
@@ -138,7 +140,7 @@
# download glut-3.7b.sparc_solaris_64.tar.gz from www.sun.com.
#GLUTHOME= /usr/local/sparc_solaris_64bit/glut-3.7
#INCLUDE= -I/usr/openwin/include -I$(GLUTHOME)/include
-#CFLAGS= -DSUN -DOOGL -DGLUT -DPTHREADS -mt $(INCLUDE) -m64
+#CFLAGS+= -DSUN -DOOGL -DGLUT -DPTHREADS -mt $(INCLUDE) -m64
#GRAPH= glutgraph.o
#GRAPHLIB= -L/usr/openwin/lib -lX11 -L$(GLUTHOME)/lib/glut -lglut -lGL -lGLU -lXmu
@@ -151,7 +153,7 @@
# Remove #'s from following 3 lines for DEC Alpha with X-windows
# Add -DOOGL to CFLAGS if you have the X version of geomview.
-#CFLAGS= -DDECALPHA -O -Olimit 2000
+#CFLAGS+= -DDECALPHA -O -Olimit 2000
#GRAPH= xgraph.o
#GRAPHLIB= -lX11
@@ -198,7 +200,7 @@
# Remove #'s from following 3 lines for HP workstation
# Omit -Aa if you're using gcc
-#CFLAGS= -Aa -D_HPUX_SOURCE -I/usr/include/X11R5
+#CFLAGS+= -Aa -D_HPUX_SOURCE -I/usr/include/X11R5
#GRAPH= xgraph.o
#GRAPHLIB= -L/usr/lib/X11R5 -lX11
@@ -206,12 +208,14 @@
# Remove #'s from following 3 lines for NeXTStep without screen graphics
# (see separate ftp archive evolver.next.tar.Z for graphics version)
-#CFLAGS= -DNeXT
+#CFLAGS+= -DNeXT
#GRAPH= nulgraph.o
#GRAPHLIB=
#-------------------End of system-specific options----------------------------
+MAINHEADERS = skeleton.h storage.h model.h web.h
+
OBJ= calcforc.o variable.o trirevis.o stringl.o stringq.o model.o\
fixvol.o query.o matrix.o grapher.o painter.o filml.o filmq.o\
torvol.o lexinit.o graphgen.o modify.o userio.o boundary.o\
@@ -230,17 +234,16 @@
evolver: makemark $(OBJ) $(GRAPH)
- $(CC) $(CFLAGS) $(OBJ) $(GRAPH) $(GRAPHLIB) -o evolver -lm
+ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(GRAPH) $(GRAPHLIB) -o evolver -lm
# This is to get global dependencies on the main header files.
-makemark: skeleton.h storage.h model.h web.h
+makemark: $(MAINHEADERS)
if [[ -z "$(GRAPH)" ]] ; then (echo "ERROR: You need to uncomment your system's lines in Makefile.") ; fi
- rm *.o || true
touch makemark
-.c.o:
- $(CC) $(CFLAGS) -c $<
-
+%.o: %.c $(MAINHEADERS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
+
# lexyy.c and ytab.c should only be remade when interface
# language is changed, which users shouldn't be touching.
|