mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 15:41:46 +00:00
Adding in sample project tree.
llvm-svn: 7018
This commit is contained in:
parent
568d13cf93
commit
e17afeb1b4
19
llvm/projects/sample/Makefile
Normal file
19
llvm/projects/sample/Makefile
Normal file
@ -0,0 +1,19 @@
|
||||
#
|
||||
# This is a sample Makefile for a project that uses LLVM.
|
||||
#
|
||||
|
||||
#
|
||||
# Indicates our relative path to the top of the project's root directory.
|
||||
#
|
||||
LEVEL = .
|
||||
|
||||
#
|
||||
# Directories that needs to be built.
|
||||
#
|
||||
DIRS = lib tools
|
||||
|
||||
#
|
||||
# Include the Master Makefile that knows how to build all.
|
||||
#
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
16
llvm/projects/sample/Makefile.common
Normal file
16
llvm/projects/sample/Makefile.common
Normal file
@ -0,0 +1,16 @@
|
||||
#
|
||||
# Set this variable to the top of the LLVM source tree.
|
||||
#
|
||||
LLVM_SRC_ROOT = $(LEVEL)/../..
|
||||
|
||||
#
|
||||
# Set this variable to the top level directory where LLVM was built
|
||||
# (this is *not* the same as OBJ_ROOT as defined in LLVM's Makefile.config).
|
||||
#
|
||||
#LLVM_OBJ_ROOT = $(LEVEL)/../..
|
||||
|
||||
#
|
||||
# Include LLVM's Master Makefile.
|
||||
#
|
||||
include $(LLVM_SRC_ROOT)/Makefile.common
|
||||
|
16
llvm/projects/sample/Makefile.config
Normal file
16
llvm/projects/sample/Makefile.config
Normal file
@ -0,0 +1,16 @@
|
||||
#
|
||||
# Set this variable to the top of the LLVM source tree.
|
||||
#
|
||||
LLVM_SRC_ROOT = $(LEVEL)/../..
|
||||
|
||||
#
|
||||
# Set this variable to the top level directory where LLVM was built
|
||||
# (i.e. where all of the object files are located).
|
||||
#
|
||||
#LLVM_OBJ_ROOT = $(LEVEL)/../..
|
||||
|
||||
#
|
||||
# Include LLVM's Makefile Makefile.
|
||||
#
|
||||
include $(LLVM_SRC_ROOT)/Makefile.config
|
||||
|
8
llvm/projects/sample/include/sample.h
Normal file
8
llvm/projects/sample/include/sample.h
Normal file
@ -0,0 +1,8 @@
|
||||
/*
|
||||
* File: sample.h
|
||||
*
|
||||
* This is a sample header file that is global to the entire project.
|
||||
* It is located here so that everyone will find it.
|
||||
*/
|
||||
extern int compute_sample (int a);
|
||||
|
11
llvm/projects/sample/lib/Makefile
Normal file
11
llvm/projects/sample/lib/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
#
|
||||
# Relative path to the top of the source tree.
|
||||
#
|
||||
LEVEL=..
|
||||
|
||||
#
|
||||
# List all of the subdirectories that we will compile.
|
||||
#
|
||||
DIRS=sample
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
16
llvm/projects/sample/lib/sample/Makefile
Normal file
16
llvm/projects/sample/lib/sample/Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
#
|
||||
# Indicate where we are relative to the top of the source tree.
|
||||
#
|
||||
LEVEL=../..
|
||||
|
||||
#
|
||||
# Give the name of a library. This will build a dynamic version.
|
||||
#
|
||||
SHARED_LIBRARY=1
|
||||
LIBRARYNAME=sample
|
||||
|
||||
#
|
||||
# Include Makefile.common so we know what to do.
|
||||
#
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
24
llvm/projects/sample/lib/sample/sample.c
Normal file
24
llvm/projects/sample/lib/sample/sample.c
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* File: sample.c
|
||||
*
|
||||
* Description:
|
||||
* This is a sample source file for a library. It helps to demonstrate
|
||||
* how to setup a project that uses the LLVM build system, header files,
|
||||
* and libraries.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// LLVM Header File
|
||||
#include "Support/DataTypes.h"
|
||||
|
||||
// Header file global to this project
|
||||
#include "sample.h"
|
||||
|
||||
int
|
||||
compute_sample (int a)
|
||||
{
|
||||
return a;
|
||||
}
|
||||
|
11
llvm/projects/sample/tools/Makefile
Normal file
11
llvm/projects/sample/tools/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
#
|
||||
# Relative path to the top of the source tree.
|
||||
#
|
||||
LEVEL=..
|
||||
|
||||
#
|
||||
# List all of the subdirectories that we will compile.
|
||||
#
|
||||
DIRS=sample
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
20
llvm/projects/sample/tools/sample/Makefile
Normal file
20
llvm/projects/sample/tools/sample/Makefile
Normal file
@ -0,0 +1,20 @@
|
||||
#
|
||||
# Indicate where we are relative to the top of the source tree.
|
||||
#
|
||||
LEVEL=../..
|
||||
|
||||
#
|
||||
# Give the name of the tool.
|
||||
#
|
||||
TOOLNAME=sample
|
||||
|
||||
#
|
||||
# List libraries that we'll need
|
||||
#
|
||||
USEDLIBS=sample
|
||||
|
||||
#
|
||||
# Include Makefile.common so we know what to do.
|
||||
#
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
14
llvm/projects/sample/tools/sample/main.c
Normal file
14
llvm/projects/sample/tools/sample/main.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sample.h"
|
||||
|
||||
int
|
||||
main (int argc, char ** argv)
|
||||
{
|
||||
printf ("%d\n", compute_sample (5));
|
||||
exit (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user