aboutsummaryrefslogtreecommitdiffstats
path: root/projects/sample/lib
diff options
context:
space:
mode:
authorJohn Criswell <criswell@uiuc.edu>2003-06-30 22:13:48 +0000
committerJohn Criswell <criswell@uiuc.edu>2003-06-30 22:13:48 +0000
commit723ccd615f99b65454e199cda9feb31f2283e787 (patch)
tree880aa2fb6590d580638a944c8bc4c8d8c9f352f8 /projects/sample/lib
parent2f8b41738ed579f91105569243919ff12be0ba0a (diff)
downloadexternal_llvm-723ccd615f99b65454e199cda9feb31f2283e787.zip
external_llvm-723ccd615f99b65454e199cda9feb31f2283e787.tar.gz
external_llvm-723ccd615f99b65454e199cda9feb31f2283e787.tar.bz2
Adding in sample project tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7018 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'projects/sample/lib')
-rw-r--r--projects/sample/lib/Makefile11
-rw-r--r--projects/sample/lib/sample/Makefile16
-rw-r--r--projects/sample/lib/sample/sample.c24
3 files changed, 51 insertions, 0 deletions
diff --git a/projects/sample/lib/Makefile b/projects/sample/lib/Makefile
new file mode 100644
index 0000000..4b97105
--- /dev/null
+++ b/projects/sample/lib/Makefile
@@ -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
diff --git a/projects/sample/lib/sample/Makefile b/projects/sample/lib/sample/Makefile
new file mode 100644
index 0000000..5569afb
--- /dev/null
+++ b/projects/sample/lib/sample/Makefile
@@ -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
+
diff --git a/projects/sample/lib/sample/sample.c b/projects/sample/lib/sample/sample.c
new file mode 100644
index 0000000..bd78ed5
--- /dev/null
+++ b/projects/sample/lib/sample/sample.c
@@ -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;
+}
+