File: fix-makefile-for-installation-to-usr-instead-of-usr-local.patch

package info (click to toggle)
splash 3.11.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,064 kB
  • sloc: f90: 55,117; ansic: 2,435; python: 828; makefile: 601; cpp: 529; perl: 219; sh: 152
file content (117 lines) | stat: -rw-r--r-- 4,013 bytes parent folder | download
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
From: =?utf-8?b?R8O8cmthbiBTZW5nw7xu?= <gurkan@phys.ethz.ch>
Date: Wed, 10 May 2017 09:48:49 +0200
Subject: fix makefile for installation to /usr instead of /usr/local

This fixes the PREFIX variable for installation and the distclean part
of the build system.
---
 Makefile       |  1 +
 build/Makefile | 22 ++++++++--------------
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index 19b857f..2bfecf7 100644
--- a/Makefile
+++ b/Makefile
@@ -22,3 +22,4 @@ docs:
 
 clean:
 	@cd build; ${MAKE} clean
+	rm -f bin/srsplash
diff --git a/build/Makefile b/build/Makefile
index 7427156..7596ccb 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -53,8 +53,7 @@ ifneq ($(BACKEND), pgplot)
    GIZA_DIR= $(PREFIX)
    PLOTLIB= giza-fortran.F90 plotlib_giza.f90
    PGPLOTLIBS = -L$(GIZA_DIR)/lib -lgiza $(CAIRO_LIBS)
-   CFLAGS= -fPIC -Wall -Wextra -O3 -g
-   CC = gcc
+   CFLAGS+= -fPIC
 else
 #-- P G P L O T --
    PLOTLIB= plotlib_pgplot.f90
@@ -125,7 +124,7 @@ OMPFLAGS=
 # default destination for installed binaries
 #
 DESTDIR=
-PREFIX=/usr/local/
+PREFIX=/usr/
 #
 # default C compiler
 #
@@ -158,8 +157,9 @@ endif
 
 ifeq ($(SYSTEM), gfortran)
 #  gfortran compiler (part of gcc 4.x.x)
+   CC = gcc
    FC= gfortran
-   FFLAGS= -O3 -fPIC
+   FFLAGS= -fPIC
    DBLFLAGS= -fdefault-real-8 -fdefault-double-8
    SYSTEMFILE= system_f2003.f90
    DEBUGFLAG= -Wall -Wextra -pedantic -g -frange-check -fcheck=all -fbacktrace \
@@ -265,7 +265,7 @@ endif
 #
 # these are the flags used for linking
 #
-LDFLAGS= $(X11_LIBS) $(PGPLOTLIBS)
+LDFLAGS+= $(X11_LIBS) $(PGPLOTLIBS)
 
 #
 # this is an option to change the endian-ness at compile time
@@ -366,7 +366,7 @@ endif
 %.o : %.f95
 	$(FC) $(FFLAGS) -c $< -o $@
 %.o : %.c
-	$(CC) -c $(CFLAGS) $(INCLUDES) $< -o $@
+	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $< -o $@
 
 # modules must be compiled in the correct order to check interfaces
 # really should include all dependencies but I am lazy
@@ -621,9 +621,6 @@ sphmoments: checksystem checkfits $(OBJECTSM)
 
 checksystem:
    ifeq ($(KNOWN_SYSTEM), yes)
-	@echo ""
-	@echo "Compiling splash for $(SYSTEM) system..........."
-	@echo ""
         ifeq ($(ENDIAN), BIG)
 	     @echo "Flags set for conversion to BIG endian"
         endif
@@ -641,7 +638,6 @@ checksystem:
         endif
         ifeq ($(FC),gfortran)
             ifeq ($(GFORTRAN_GE_4_4),true)
-		@echo "compiling with gfortran v$(GFORTRAN_VERSION) (OK)"
             else
 		${error gfortran v$(GFORTRAN_VERSION) is too old to compile this version of splash: please upgrade your gfortran}
             endif
@@ -768,6 +764,7 @@ installcheck:
         $(MAKE) err; fi
 
 destdircheck: installcheck
+	mkdir -p $(DESTDIR)$(PREFIX)/bin
 	@if test -d $(DESTDIR)$(PREFIX)/bin; then echo $(DESTDIR)$(PREFIX)/bin exists and is a directory; else \
         echo; echo "*** ERROR in make install ***"; echo "$(DESTDIR)$(PREFIX)/bin is not a valid directory"; echo;\
         $(MAKE) err; fi;
@@ -802,7 +799,7 @@ withgiza: ../giza/lib/libgiza.a
 
 ../giza/lib/libgiza.a:
 	@echo "Compiling local copy of giza..."
-	cd ../giza; ./configure --prefix="$(PWD)/../giza" CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="" CAIRO_LIBS="$(CAIRO_LIBS)" CAIRO_CFLAGS="$(CAIRO_CFLAGS)" X11_LIBS="$(X11_LIBS)" X11_CFLAGS="$(X11_CFLAGS)"
+	cd ../giza; ./configure --prefix="$(PWD)/../giza" CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="" CAIRO_LIBS="$(CAIRO_LIBS)" CAIRO_CFLAGS="$(CAIRO_CFLAGS)" X11_LIBS="$(X11_LIBS)" X11_CFLAGS="$(X11_CFLAGS) CPPFLAGS="$(CPPFLAGS)"
 	cd ../giza; $(MAKE) $(MAKECMDFLAGS) install CC="$(CC)" CFLAGS="$(CFLAGS)"
 
 docs: doc
@@ -827,9 +824,6 @@ targz:
 	gzip splash.tar
 
 ## unit tests of various modules as I write them
-.PHONY: tests
-
-test: test1 test2 test3 test_slicer test_prompt test-parse
 
 test1: interpolate3D_projection.o interpolate3D_xsec.o test_interpolate3D.o
 	$(FC) $(FFLAGS) $(LDFLAGS) -o $(BINDIR)/test_interpolation3D $(TESTDIR)/test_interpolate3D.o interpolate3D_projection.o interpolate3D_xsec.o