From 80973ceb8cb5e16b2abf5bedda61fb0b5118796e Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 7 Feb 2013 22:44:50 -0500 Subject: [PATCH] add import example --- .gitignore | 1 + import/Makefile | 13 +++++++++++++ import/file1 | 1 + import/file2/file2 | 2 ++ import/import.d | 9 +++++++++ 5 files changed, 26 insertions(+) create mode 100644 import/Makefile create mode 100644 import/file1 create mode 100644 import/file2/file2 create mode 100644 import/import.d diff --git a/.gitignore b/.gitignore index 3ba9bbf..6c33f84 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ init/init factorial/factorial datatypes/datatypes appending/appending +import/import diff --git a/import/Makefile b/import/Makefile new file mode 100644 index 0000000..e2e1746 --- /dev/null +++ b/import/Makefile @@ -0,0 +1,13 @@ + +TARGET := import +DFLAGS := -funittest -J. + +all: $(TARGET) + +$(TARGET): $(TARGET).d + +%: %.d + gdc -o $@ $(DFLAGS) $< + +clean: + -rm -f *.o *~ $(TARGET) diff --git a/import/file1 b/import/file1 new file mode 100644 index 0000000..c278a75 --- /dev/null +++ b/import/file1 @@ -0,0 +1 @@ +This is file1 diff --git a/import/file2/file2 b/import/file2/file2 new file mode 100644 index 0000000..3899654 --- /dev/null +++ b/import/file2/file2 @@ -0,0 +1,2 @@ +This is file2 +It has two lines. diff --git a/import/import.d b/import/import.d new file mode 100644 index 0000000..3fe820a --- /dev/null +++ b/import/import.d @@ -0,0 +1,9 @@ +import std.stdio; + +void main(string[] args) +{ + writefln("file1:"); + writefln(import("file1")); + writefln("file2/file2:"); + writefln(import("file2/file2")); +}