summaryrefslogtreecommitdiff
blob: 10d116a7f00747353396edc202fca1f538c8cc4f (plain)
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
From: Julian Ospald <hasufell@gentoo.org>
Date: Sun Apr 21 16:14:18 UTC 2013
Subject: build system

respect CFLAGS, LDFLAGS and don't do other silly stuff

--- skychart-3.8-2450-src/skychart/library/getdss/Makefile
+++ skychart-3.8-2450-src/skychart/library/getdss/Makefile
@@ -1,21 +1,21 @@
 CPPFLAGS=-I. -DUNIX -D_CONSOLE -fPIC $(arch_flags)
 #### For Suns and similar wrong-endian computers, add -DWRONG_WAY_BYTE_ORDER.
-CC            = gcc
+CC            ?= gcc
 OSTYPE = $(shell uname)
 ifneq ($(findstring Darwin,$(OSTYPE)),)
 SO_Name = libgetdss.dylib
-LDFLAGS=  -Wl,-single_module -dynamiclib  -lc -lm -lstdc++
+LDFLAGS +=  -Wl,-single_module -dynamiclib  -lc -lm -lstdc++
 else
 SO_Name = libgetdss.so
-LDFLAGS= -shared -Wl,-soname,$(SO_Name) $(arch_flags)
+LDFLAGS += -shared -Wl,-soname,$(SO_Name) $(arch_flags)
 endif
 ifneq ($(findstring W32,$(OSTYPE)),)
 SO_Name = libgetdss.dll
-LDFLAGS= -shared -Wl,-soname,$(SO_Name)
+LDFLAGS += -shared -Wl,-soname,$(SO_Name)
 endif
 ifneq ($(findstring MINGW,$(OSTYPE)),)
 SO_Name = libgetdss.dll
-LDFLAGS= -shared -Wl,-soname,$(SO_Name)
+LDFLAGS += -shared -Wl,-soname,$(SO_Name)
 endif
 OBJS = getdss_lib.o dss.o extr_fit.o getpiece.o \
 	hdcmprss.o bitinput.o decode.o dodecode.o hinv.o \
@@ -25,7 +25,7 @@
 all: $(SO_Name)
 
 $(SO_Name):  $(OBJS)
-	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
+	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
 	
 clean:
 	rm -f $(OBJS) $(SO_Name)
--- skychart-3.8-2450-src/skychart/library/plan404/Makefile
+++ skychart-3.8-2450-src/skychart/library/plan404/Makefile
@@ -1,7 +1,7 @@
 # Common flags
-CC            = gcc
+CC            ?= gcc
 #CFLAGS        = -O3 -ffast-math (fast-math removed for better compatibility )
-CFLAGS        = -O3 -fPIC $(arch_flags)
+CFLAGS        += -fPIC $(arch_flags)
 OSTYPE = $(shell uname)
 ifneq ($(findstring Darwin,$(OSTYPE)),)
 SO_Name       = libplan404.dylib
@@ -35,7 +35,7 @@
 	$(CC) $(CFLAGS) -c $< -o $@
 
 $(SO_Name): $(OBJ)
-	$(CC) $(CFLAGS) $(LIBFLAGS) -o $@ $(OBJ)
+	$(CC) $(CFLAGS) $(LDFLAGS) $(LIBFLAGS) -o $@ $(OBJ)
 
 clean:
 	rm -f $(OBJ) $(SO_Name)
--- skychart-3.8-2450-src/skychart/library/wcs/Makefile
+++ skychart-3.8-2450-src/skychart/library/wcs/Makefile
@@ -1,5 +1,5 @@
-CFLAGS= -g -w -fPIC $(arch_flags)
-CC= gcc
+CFLAGS += -w -fPIC $(arch_flags)
+CC ?= gcc
 
 OSTYPE = $(shell uname)
 ifneq ($(findstring Darwin,$(OSTYPE)),)
@@ -29,7 +29,7 @@
 all: $(SO_Name)
 
 $(SO_Name): $(OBJS)
-	$(CC) $(CFLAGS) $(LIBFLAGS) -o $@ $(OBJS)
+	$(CC) $(CFLAGS) $(LDFLAGS) $(LIBFLAGS) -o $@ $(OBJS)
 
 cdcwcs.o:	fitsfile.h wcs.h
 actread.o:	fitsfile.h wcscat.h wcs.h fitshead.h wcslib.h
--- skychart-3.8-2450-src/skychart/library/Makefile.in
+++ skychart-3.8-2450-src/skychart/library/Makefile.in
@@ -23,14 +23,14 @@
         $(MAKE) -C wcs -f Makefile.win64 all
  else
  ifeq ($(CPU_TARGET),i386)
-        $(MAKE) -C getdss all arch_flags=-m32
-        $(MAKE) -C plan404 all arch_flags=-m32
-        $(MAKE) -C wcs all arch_flags=-m32
+        $(MAKE) -C getdss all
+        $(MAKE) -C plan404 all
+        $(MAKE) -C wcs all
  else
  ifeq ($(CPU_TARGET),x86_64)
-        $(MAKE) -C getdss all arch_flags=-m64
-        $(MAKE) -C plan404 all arch_flags=-m64
-        $(MAKE) -C wcs all arch_flags=-m64
+        $(MAKE) -C getdss all
+        $(MAKE) -C plan404 all
+        $(MAKE) -C wcs all
  else
 	$(MAKE) -C getdss all
         $(MAKE) -C plan404 all