llvm.org GIT mirror llvm / 723ccd6
Adding in sample project tree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7018 91177308-0d34-0410-b5e6-96231b3b80d8 John Criswell 16 years ago
10 changed file(s) with 155 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 #
1 # This is a sample Makefile for a project that uses LLVM.
2 #
3
4 #
5 # Indicates our relative path to the top of the project's root directory.
6 #
7 LEVEL = .
8
9 #
10 # Directories that needs to be built.
11 #
12 DIRS = lib tools
13
14 #
15 # Include the Master Makefile that knows how to build all.
16 #
17 include $(LEVEL)/Makefile.common
18
0 #
1 # Set this variable to the top of the LLVM source tree.
2 #
3 LLVM_SRC_ROOT = $(LEVEL)/../..
4
5 #
6 # Set this variable to the top level directory where LLVM was built
7 # (this is *not* the same as OBJ_ROOT as defined in LLVM's Makefile.config).
8 #
9 #LLVM_OBJ_ROOT = $(LEVEL)/../..
10
11 #
12 # Include LLVM's Master Makefile.
13 #
14 include $(LLVM_SRC_ROOT)/Makefile.common
15
0 #
1 # Set this variable to the top of the LLVM source tree.
2 #
3 LLVM_SRC_ROOT = $(LEVEL)/../..
4
5 #
6 # Set this variable to the top level directory where LLVM was built
7 # (i.e. where all of the object files are located).
8 #
9 #LLVM_OBJ_ROOT = $(LEVEL)/../..
10
11 #
12 # Include LLVM's Makefile Makefile.
13 #
14 include $(LLVM_SRC_ROOT)/Makefile.config
15
0 /*
1 * File: sample.h
2 *
3 * This is a sample header file that is global to the entire project.
4 * It is located here so that everyone will find it.
5 */
6 extern int compute_sample (int a);
7
0 #
1 # Relative path to the top of the source tree.
2 #
3 LEVEL=..
4
5 #
6 # List all of the subdirectories that we will compile.
7 #
8 DIRS=sample
9
10 include $(LEVEL)/Makefile.common
0 #
1 # Indicate where we are relative to the top of the source tree.
2 #
3 LEVEL=../..
4
5 #
6 # Give the name of a library. This will build a dynamic version.
7 #
8 SHARED_LIBRARY=1
9 LIBRARYNAME=sample
10
11 #
12 # Include Makefile.common so we know what to do.
13 #
14 include $(LEVEL)/Makefile.common
15
0 /*
1 * File: sample.c
2 *
3 * Description:
4 * This is a sample source file for a library. It helps to demonstrate
5 * how to setup a project that uses the LLVM build system, header files,
6 * and libraries.
7 */
8
9 #include
10 #include
11
12 // LLVM Header File
13 #include "Support/DataTypes.h"
14
15 // Header file global to this project
16 #include "sample.h"
17
18 int
19 compute_sample (int a)
20 {
21 return a;
22 }
23
0 #
1 # Relative path to the top of the source tree.
2 #
3 LEVEL=..
4
5 #
6 # List all of the subdirectories that we will compile.
7 #
8 DIRS=sample
9
10 include $(LEVEL)/Makefile.common
0 #
1 # Indicate where we are relative to the top of the source tree.
2 #
3 LEVEL=../..
4
5 #
6 # Give the name of the tool.
7 #
8 TOOLNAME=sample
9
10 #
11 # List libraries that we'll need
12 #
13 USEDLIBS=sample
14
15 #
16 # Include Makefile.common so we know what to do.
17 #
18 include $(LEVEL)/Makefile.common
19
0 #include
1 #include
2
3 #include
4
5 #include "sample.h"
6
7 int
8 main (int argc, char ** argv)
9 {
10 printf ("%d\n", compute_sample (5));
11 exit (0);
12 }
13