-
Notifications
You must be signed in to change notification settings - Fork 322
/
Makefile.nagfortran
50 lines (40 loc) · 1.43 KB
/
Makefile.nagfortran
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
##===- Makefile.nagfortran ---------------------------------*- Makefile -*-===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===------------------------------------------------------------------------===#
#
# Enable running Fortran programs with LLVM by using NAGWare Fortran front-end
# to convert it to C.
#
##===----------------------------------------------------------------------===##
include $(LEVEL)/Makefile.config
# Make sure the correct targets come first.
ifdef TEST
test::
else
all::
endif
ifneq ($(USE_F95),1)
all test::
echo "NAG Fortran is not support?"
exit 1
endif
.PRECIOUS: %.c
clean::
rm -f $(patsubst %.f,%.c, $(filter %.f,$(Source))) \
$(patsubst %.F,%.c, $(filter %.F,$(Source))) \
$(patsubst %.f90,%.c, $(filter %.f90,$(Source))) \
$(patsubst %.F90,%.c, $(filter %.F90,$(Source)))
%.c: %.f
-$(F95) -w -S -O2 $< -o $@ $(NAGFORTRAN_FLAGS)
%.f: %.F
-$(PROJ_SRC_ROOT)/filepp $< -o $@ -M $(SPEC_BENCH_DIR)/src/ $(FPPFLAGS)
%.c: %.f90
-$(F95) -w -S -O2 $< -o $@ $(NAGFORTRAN_FLAGS)
%.f90: %.F90
-$(PROJ_SRC_ROOT)/filepp $< -o $@ -M $(SPEC_BENCH_DIR)/src/ $(FPPFLAGS)
CPPFLAGS += -I$(F95_DIR)/lib/NAGWare
LDFLAGS += $(F95_DIR)/lib/NAGWare/quickfit.o -Xlinker -flat_namespace $(F95_DIR)/lib/NAGWare/libf97.dylib $(F95_DIR)/lib/NAGWare/libf96.a