Minor changes in makefile(s)
netzel

netzel commited on 2024-05-16 14:28:21
Showing 2 changed files, with 9 additions and 6 deletions.

... ...
@@ -3,10 +3,12 @@ PROG = pldarksky
3 3
 
4 4
 CC = gcc
5 5
 
6
-CFLAGS=-Wall -O3 -fopenmp -msse2 -mfpmath=sse -Wl,-rpath,'$$ORIGIN/' -I/usr/include/gdal -lgdal -lezgdal -largtable3 -lm
6
+CFLAGS=-Wall -O3 -fopenmp -msse2 -mfpmath=sse -Wl,-rpath,'$$ORIGIN/' -I/usr/include/gdal
7
+LIBFLAGS = -lgdal -lezgdal -largtable3 -lm
7 8
 
8 9
 COMMON_C = $(shell ls *.c)
9 10
 COMMON_C_O = $(COMMON_C:%.c=%.o)
11
+HEADERS = $(shell ls *.h)
10 12
 
11 13
 ifndef PREFIX
12 14
   PREFIX = /usr/local
... ...
@@ -16,10 +18,10 @@ endif
16 18
 default: $(PROG)
17 19
 
18 20
 $(PROG): $(COMMON_C_O) $(HEADERS)
19
-	$(CC) $(CFLAGS) -o $(PROG) $(COMMON_O) $(COMMON_C_O)
21
+	$(CC) $(CFLAGS) -o $(PROG) $(COMMON_O) $(COMMON_C_O) $(LIBFLAGS)
20 22
 
21 23
 $(COMMON_C_O): $(COMMON_C) $(HEADERS_C)
22
-	$(CC) $(CFLAGS) -c  $(COMMON_C)
24
+	$(CC) $(CFLAGS) -c  $(COMMON_C) $(LIBFLAGS)
23 25
 
24 26
 install: 
25 27
 	cp -f $(PROG) $(PREFIX)/bin
... ...
@@ -2,7 +2,8 @@ PROG = pldarksky.exe
2 2
 
3 3
 CC = x86_64-w64-mingw32-gcc 
4 4
 
5
-CFLAGS= -I../../Win64_cross/gdal/include -I../../Win64_cross/ezgdal -I../../Win64_cross/argtable3 -L../../Win64_cross/argtable3 -L../../Win64_cross/gdal/bin -L../../Win64_cross/ezgdal -Wall -O3 -fopenmp -msse2 -mfpmath=sse -lgdal -llibezgdal -llibargtable3 -lm
5
+CFLAGS= -I../../Win64_cross/gdal/include -I../../Win64_cross/ezgdal -I../../Win64_cross/argtable3 -L../../Win64_cross/argtable3 -L../../Win64_cross/gdal/bin -L../../Win64_cross/ezgdal -Wall -O3 -fopenmp -msse2 -mfpmath=sse
6
+LIBFLAGS = -lgdal -llibezgdal -llibargtable3 -lm
6 7
 
7 8
 COMMON_C = $(shell ls *.c)
8 9
 COMMON_C_O = $(COMMON_C:%.c=%.o)
... ...
@@ -11,10 +12,10 @@ HEADERS = $(shell ls *.h)
11 12
 default: $(PROG)
12 13
 
13 14
 $(PROG): $(COMMON_C_O) $(HEADERS)
14
-	$(CC) $(CFLAGS) -o $(PROG) $(COMMON_C_O)
15
+	$(CC) $(CFLAGS) -o $(PROG) $(COMMON_C_O) $(LIBFLAGS)
15 16
 
16 17
 $(COMMON_C_O): $(COMMON_C) $(HEADERS)
17
-	$(CC) $(CFLAGS) -c  $(COMMON_C)
18
+	$(CC) $(CFLAGS) -c  $(COMMON_C) $(LIBFLAGS)
18 19
 
19 20
 clean:
20 21
 	rm -f *.o $(PROG)
21 22