forked from gmcgarragh/seviri_util
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (60 loc) · 2.27 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
#*******************************************************************************
#
# Copyright (C) 2014-2018 Greg McGarragh <[email protected]>
#
# This source code is licensed under the GNU General Public License (GPL),
# Version 3. See the file COPYING for more details.
#
#*******************************************************************************
.SUFFIXES: .c .f90
OBJECTS = internal.o \
misc_util.o \
nav_util.o \
preproc.o \
read_write.o \
read_write_hrit.o \
read_write_nat.o \
hrit_anc_funcs.o
include make.inc
all: libseviri_util.a \
example_c \
$(OPTIONAL_TARGETS)
libseviri_util.a: $(OBJECTS)
ar -rs libseviri_util.a $(OBJECTS)
seviri_util_f90.o: seviri_util_f90.f90
seviri_util.so: seviri_util_py.o libseviri_util.a
$(CC) $(CCFLAGS) -shared -o seviri_util.so seviri_util_py.o libseviri_util.a
seviri_util_dlm.so: seviri_util_dlm.o libseviri_util.a
$(CC) $(CCFLAGS) -shared -o seviri_util_dlm.so seviri_util_dlm.o libseviri_util.a
SEVIRI_util: SEVIRI_util.o SEVIRI_util_funcs.o SEVIRI_util_prog.o libseviri_util.a
$(CC) $(CCFLAGS) -o SEVIRI_util SEVIRI_util_funcs.o SEVIRI_util_prog.o SEVIRI_util.o \
libseviri_util.a $(INCDIRS) $(LIBDIRS) $(LINKS)
example_c: example_c.c libseviri_util.a
$(CC) $(CCFLAGS) -o example_c example_c.c libseviri_util.a -lm
example_f90: example_f90.f90 libseviri_util.a
$(F90) $(F90FLAGS) -o example_f90 example_f90.f90 libseviri_util.a -lm
README: readme_source.txt
fold --spaces --width=80 readme_source.txt > README
sed -i 's/[ \t]*$$//' README
clean:
rm -f *.a *.o *.mod example_c example_f90 $(OPTIONAL_TARGETS)
.c.o:
$(CC) $(CCFLAGS) $(INCDIRS) -c -o $*.o $<
%.o : %.mod
.f90.o:
$(F90) $(F90FLAGS) $(INCDIRS) -c -o $*.o $<
# Requires gcc
depend:
@files=`find . -maxdepth 1 -name "*.c" | sort`; \
if test $${#files} != 0; then \
if (eval gcc -v 1> /dev/null 2>&1); then \
echo gcc -MM -w $$files "> depend.inc"; \
gcc -MM -w $$files > dep.inc; \
else \
echo makedepend -f- -Y -- -- $$files "> depend.inc"; \
makedepend -f- -Y -- -- $$files > dep.inc; \
fi \
else \
echo -n '' > dep.inc; \
fi
include depend.inc