summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2017-01-03 12:15:54 -0700
committermo khan <mo@mokhan.ca>2017-01-03 12:15:54 -0700
commitf9898440349580c95603a4e691bdd9600712b301 (patch)
treebde7c2c085b63b4f38695726509b5c744329d018
parentb9a8e9ccb80b78dd30b669e0947e341318f2803a (diff)
create makefile.
-rw-r--r--.gitignore2
-rw-r--r--Makefile14
-rw-r--r--bin/.gitkeep0
-rw-r--r--src/main.c (renamed from main.c)8
4 files changed, 22 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index f47cb20..ebda924 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
*.out
+*.o
+bin
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..1ee69d1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,14 @@
+SHELL=/bin/sh
+CFLAGS=-Wall -g -std=c99 -Isrc -lncurses
+objects=main.o
+exe=./bin/curse-you
+
+all: $(objects)
+ $(CC) $(CFLAGS) -o $(exe) $(objects)
+ $(exe)
+
+clean:
+ rm -fr $(exe) $(objects)
+
+main.o: src/main.c
+ $(CC) $(CFLAGS) -c src/main.c
diff --git a/bin/.gitkeep b/bin/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bin/.gitkeep
diff --git a/main.c b/src/main.c
index 6276ca8..24ad982 100644
--- a/main.c
+++ b/src/main.c
@@ -1,11 +1,15 @@
#include <ncurses.h>
-int main(int argc, const char *argv[])
-{
+void hello_world() {
initscr();
printw("Hello world!!!");
refresh();
getch();
endwin();
+}
+
+int main(int argc, const char *argv[])
+{
+ hello_world();
return 0;
}