forked from ClimateGlobalChange/tempestextremes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Make.defs
46 lines (39 loc) · 941 Bytes
/
Make.defs
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
##
## Compilation directories
##
DEPDIR=depend
BUILDDIR=build
##
## Dependency file construction
##
DEPDIR=depend
MAKEDEPEND=mkdir -p $(DEPDIR); \
echo "-- Generating dependencies for $<"; \
touch $(DEPDIR)/$*.P && makedepend -- $(CFLAGS) -- -f $(DEPDIR)/$*.P $< > /dev/null 2>&1; \
sed 's/\($*\)\.o[ :]*/$(BUILDDIR)\/\1.o $(DEPDIR)\/$*.d : /g' < $(DEPDIR)/$*.P > $(DEPDIR)/$*.d; \
rm -f $(DEPDIR)/$*.P
#$(CC) -M $(CFLAGS) $< > $(DEPDIR)/$*.P; \
##
## Compilation rules
##
$(BUILDDIR)/%.o : %.cpp
@mkdir -p $(BUILDDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(BUILDDIR)/%.o : %.c
@mkdir -p $(BUILDDIR)
$(CCOMP) $(CFLAGS) -c -o $@ $<
$(BUILDDIR)/%.o : %.f90
@mkdir -p $(BUILDDIR)
$(F90) $(FORTFLAGS) -c -o $@ $<
$(BUILDDIR)/%.o : %.f
@mkdir -p $(BUILDDIR)
$(F90) $(FORTFLAGS) -c -o $@ $<
##
## Dependency generation
##
$(DEPDIR)/%.d : %.cpp
@$(MAKEDEPEND)
$(DEPDIR)/%.d : %.f90
@$(MAKEDEPEND)
$(DEPDIR)/%.d : %.f
@$(MAKEDEPEND)