Permalink
Browse files

add vpath

  • Loading branch information...
1 parent 2bf9b9f commit b17e2c8f9aea77b29641ec224fd75eabb4f82a4a @liweinan committed Mar 10, 2013
Showing with 25 additions and 0 deletions.
  1. +9 −0 make/vpath/Makefile
  2. +5 −0 make/vpath/include/hello.h
  3. +5 −0 make/vpath/src/hello.c
  4. +6 −0 make/vpath/src/main.c
View
@@ -0,0 +1,9 @@
+vpath %.c src
+vpath %.h include
+
+main: hello.c main.c hello.h
+ gcc -I include $^ -o $@
+
+.PHONY: clean
+clean:
+ rm -rf main
@@ -0,0 +1,5 @@
+#ifndef _HELLO_H_
+#define _HELLO_H_
+
+extern void say_hello();
+#endif
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+say_hello() {
+ printf("Hello, world!");
+}
@@ -0,0 +1,6 @@
+#include <hello.h>
+
+int main() {
+ say_hello();
+ return 0;
+}

0 comments on commit b17e2c8

Please sign in to comment.