-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
97 lines (72 loc) · 1.93 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Define variables for internal Lua source code
EXTERNAL_LUA_V = 5.4.7
# Default platform
PLATFORM ?= linux
# Define VPATH
VPATH ?= $(shell pwd)
# the default target
.PHONY: default
default: lib
# the all target
.PHONY: all static
all: static
# SMEKASETTINGS (DO NOT DELETE)
# DO NOT CHANGE CONTENT IN THIS BLOCK
# IT MAY BE OVERWRITTEN WHEN REINSTALLING SMEKA
#
# This Makefile was created by smeka:
# github.com/zerothi/smeka
# Top-directory of Makefile/source tree
# If need set, do so ABOVE this block!
TOP_DIR ?= .
# Directory of smeka default Makefiles
SMEKA_DIR = smeka
# Include the smeka settings!
include $(TOP_DIR)/$(SMEKA_DIR)/Makefile.smeka
# SMEKAENDSETTINGS (DO NOT DELETE)
# The linker is a fortran compiler
LINK := $(FC)
# Create targets for the library
.PHONY: lib lua-lib
lib: $(LIBRARIES)
# Determine whether the user has added an external
# Lua header file.
ifdef LUA_DIR
# User-defined
INCLUDES += -I$(LUA_DIR)/include
LUA__LIB = $(LUA_DIR)/lib/liblua.a
lua-lib:
@echo ""
@echo "Adding external Lua library to lib$(AOTUS_LIB).*"
@echo "Extracting $(LUA_DIR)/lib/liblua.a"
@echo ""
$(AR) -x $(LUA__LIB)
else
# lua-sources shipped
LUA_DIR = external/lua-$(EXTERNAL_LUA_V)
INCLUDES += -I$(LUA_DIR)/src
LUA__LIB = $(LUA_DIR)/src/liblua.a
lua-lib:
mkdir -p external
cp -rf $(TOP_DIR)/$(LUA_DIR) external/
$(MAKE) -C $(LUA_DIR) $(PLATFORM)
$(AR) -x $(LUA__LIB)
# Ensure the Lua-library is built first
$(LIBRARIES): |lua-lib
# Add cleaning target
.PHONY: clean-lua-lib
clean-lua-lib:
$(MAKE) -C $(LUA_DIR) clean
-rm -f *.o
clean: clean-lua-lib
endif
# Add the LuaFortran files
include $(TOP_DIR)/LuaFortran/Makefile.inc
# Add source files
include $(TOP_DIR)/source/Makefile.inc
# Add source/extdouble files
include $(TOP_DIR)/source/extdouble/Makefile.inc
# Add source/quadruple files
include $(TOP_DIR)/source/quadruple/Makefile.inc
# Ensure that all objects are required for the libraries
$(LIBRARIES): $(OBJECTS)