@@ -8,102 +8,79 @@ LEVEL :=..
8
8
LIBRARYNAME =LLVMPolly
9
9
LOADABLE_MODULE = 1
10
10
11
- include $( LEVEL ) /Makefile.config
11
+ # TODO: Export symbols for RTTI or EH?
12
12
13
13
CPP.Flags += $(POLLY_INC )
14
+ LD.Flags += $(POLLY_LD ) $(POLLY_LIB )
14
15
15
- DIRS = Exchange
16
- USEDLIBS = pollyexchange.a
17
-
18
- DIRS += Analysis
19
- USEDLIBS += pollyanalysis.a
20
-
21
- DIRS += CodeGen
22
- USEDLIBS += pollycodegen.a
23
-
24
- # This needs to be added after the files that use it, otherwise some functions
25
- # from pollysupport are not available. They will be eliminated if they are
26
- # not used at the time of linking pollysupport.a
27
- DIRS += Support
28
- USEDLIBS += pollysupport.a
29
-
30
- DIRS += JSON
31
- USEDLIBS += pollyjson.a
16
+ LIBS += $(POLLY_LD ) $(POLLY_LIB )
32
17
33
- DIRS += Transform
34
- USEDLIBS += pollytransform.a
18
+ include $(LEVEL ) /Makefile.config
35
19
36
- # TODO: Export symbols for RTTI or EH?
20
+ # Enable optional source files
21
+ ifeq ($(CLOOG_FOUND ) , yes)
22
+ CLOOG_FILES = CodeGen/Cloog.cpp \
23
+ CodeGen/CodeGeneration.cpp
24
+ endif
25
+
26
+ ifeq ($(GPU_CODEGEN ) , yes)
27
+ GPGPU_CODEGEN_FILES = CodeGen/PTXGenerator.cpp
28
+ endif
29
+
30
+ ifeq ($(PLUTO_FOUND ) , yes)
31
+ POLLY_PLUTO_FILES = Transform/Pluto.cpp
32
+ endif
33
+
34
+ ifeq ($(OPENSCOP_FOUND ) , yes)
35
+ POLLY_OPENSCOP_FILES = Exchange/OpenScopImporter.cpp \
36
+ Exchange/OpenScopExporter.cpp
37
+ endif
38
+
39
+ ifeq ($(SCOPLIB_FOUND ) , yes)
40
+ POLLY_SCOPLIB_FILES = Exchange/ScopLib.cpp \
41
+ Exchange/ScopLibExporter.cpp \
42
+ Exchange/ScopLibImporter.cpp \
43
+ Transform/Pocc.cpp
44
+ endif
45
+
46
+ ISL_CODEGEN_FILES = CodeGen/IslAst.cpp \
47
+ CodeGen/IslCodeGeneration.cpp
48
+
49
+ POLLY_JSON_FILES = JSON/json_reader.cpp \
50
+ JSON/json_value.cpp \
51
+ JSON/json_writer.cpp
52
+
53
+ SOURCES = Polly.cpp \
54
+ Support/GICHelper.cpp \
55
+ Support/SCEVValidator.cpp \
56
+ Support/RegisterPasses.cpp \
57
+ Support/ScopHelper.cpp \
58
+ Analysis/Dependences.cpp \
59
+ Analysis/ScopDetection.cpp \
60
+ Analysis/ScopInfo.cpp \
61
+ Analysis/ScopGraphPrinter.cpp \
62
+ Analysis/ScopPass.cpp \
63
+ Analysis/TempScopInfo.cpp \
64
+ CodeGen/BlockGenerators.cpp \
65
+ CodeGen/LoopGenerators.cpp \
66
+ CodeGen/IRBuilder.cpp \
67
+ CodeGen/Utils.cpp \
68
+ Exchange/JSONExporter.cpp \
69
+ Transform/Canonicalization.cpp \
70
+ Transform/CodePreparation.cpp \
71
+ Transform/DeadCodeElimination.cpp \
72
+ Transform/IndependentBlocks.cpp \
73
+ Transform/IndVarSimplify.cpp \
74
+ Transform/ScheduleOptimizer.cpp \
75
+ ${GPGPU_FILES} \
76
+ ${ISL_CODEGEN_FILES} \
77
+ ${CLOOG_FILES} \
78
+ ${POLLY_JSON_FILES} \
79
+ ${POLLY_OPENSCOP_FILES} \
80
+ ${POLLY_PLUTO_FILES} \
81
+ ${POLLY_SCOPLIB_FILES}
37
82
38
83
#
39
84
# Include Makefile.common so we know what to do.
40
85
#
41
86
include $(LEVEL ) /Makefile.common
42
-
43
- LIBS += $(POLLY_LD ) $(POLLY_LIB )
44
-
45
- $(LibDir ) /libpollyanalysis.a : $(LibDir ) /.dir $(PROJ_OBJ_DIR ) /Analysis/$(BuildMode ) /.dir \
46
- $(PROJ_SRC_DIR)/Analysis/*
47
- $(Verb) if [ -d $(PROJ_SRC_DIR)/Analysis ]; then\
48
- if ([ ! -f Analysis/Makefile ] || \
49
- command test Analysis/Makefile -ot $(PROJ_SRC_DIR)/Analysis/Makefile ); then \
50
- $(MKDIR) Analysis; \
51
- $(CP) $(PROJ_SRC_DIR)/Analysis/Makefile Analysis/Makefile; \
52
- fi; \
53
- ($(MAKE) -C Analysis $@ ) || exit 1; \
54
- fi
55
-
56
- $(LibDir ) /libpollycodegen.a : $(LibDir ) /.dir $(PROJ_OBJ_DIR ) /CodeGen/$(BuildMode ) /.dir \
57
- $(PROJ_SRC_DIR)/CodeGen/*
58
- $(Verb) if [ -d $(PROJ_SRC_DIR)/CodeGen ]; then\
59
- if ([ ! -f CodeGen/Makefile ] || \
60
- command test CodeGen/Makefile -ot $(PROJ_SRC_DIR)/CodeGen/Makefile ); then \
61
- $(MKDIR) CodeGen; \
62
- $(CP) $(PROJ_SRC_DIR)/CodeGen/Makefile CodeGen/Makefile; \
63
- fi; \
64
- ($(MAKE) -C CodeGen $@ ) || exit 1; \
65
- fi
66
-
67
- $(LibDir ) /libpollyexchange.a : $(LibDir ) /.dir $(PROJ_OBJ_DIR ) /Exchange/$(BuildMode ) /.dir \
68
- $(PROJ_SRC_DIR)/Exchange/*
69
- $(Verb) if [ -d $(PROJ_SRC_DIR)/Exchange ]; then\
70
- if ([ ! -f Exchange/Makefile ] || \
71
- command test Exchange/Makefile -ot $(PROJ_SRC_DIR)/Exchange/Makefile ); then \
72
- $(MKDIR) Exchange; \
73
- $(CP) $(PROJ_SRC_DIR)/Exchange/Makefile Exchange/Makefile; \
74
- fi; \
75
- ($(MAKE) -C Exchange $@ ) || exit 1; \
76
- fi
77
-
78
- $(LibDir ) /libpollysupport.a : $(LibDir ) /.dir $(PROJ_OBJ_DIR ) /Support/$(BuildMode ) /.dir \
79
- $(PROJ_SRC_DIR)/Support/*
80
- $(Verb) if [ -d $(PROJ_SRC_DIR)/Support ]; then\
81
- if ([ ! -f Support/Makefile ] || \
82
- command test Support/Makefile -ot $(PROJ_SRC_DIR)/Support/Makefile ); then \
83
- $(MKDIR) Support; \
84
- $(CP) $(PROJ_SRC_DIR)/Support/Makefile Support/Makefile; \
85
- fi; \
86
- ($(MAKE) -C Support $@ ) || exit 1; \
87
- fi
88
-
89
- $(LibDir ) /libpollyjson.a : $(LibDir ) /.dir $(PROJ_OBJ_DIR ) /JSON/$(BuildMode ) /.dir \
90
- $(PROJ_SRC_DIR)/JSON/*
91
- $(Verb) if [ -d $(PROJ_SRC_DIR)/JSON ]; then\
92
- if ([ ! -f JSON/Makefile ] || \
93
- command test JSON/Makefile -ot $(PROJ_SRC_DIR)/JSON/Makefile ); then \
94
- $(MKDIR) JSON; \
95
- $(CP) $(PROJ_SRC_DIR)/JSON/Makefile JSON/Makefile; \
96
- fi; \
97
- ($(MAKE) -C JSON $@ ) || exit 1; \
98
- fi
99
-
100
- $(LibDir ) /libpollytransform.a : $(LibDir ) /.dir $(PROJ_OBJ_DIR ) /Transform/$(BuildMode ) /.dir \
101
- $(PROJ_SRC_DIR)/Transform/*
102
- $(Verb) if [ -d $(PROJ_SRC_DIR)/Transform ]; then\
103
- if ([ ! -f Transform/Makefile ] || \
104
- command test Transform/Makefile -ot $(PROJ_SRC_DIR)/Transform/Makefile ); then \
105
- $(MKDIR) Transform; \
106
- $(CP) $(PROJ_SRC_DIR)/Transform/Makefile Transform/Makefile; \
107
- fi; \
108
- ($(MAKE) -C Transform $@ ) || exit 1; \
109
- fi
0 commit comments