Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add vpath

  • Loading branch information...
commit b17e2c8f9aea77b29641ec224fd75eabb4f82a4a 1 parent 2bf9b9f
@liweinan authored
View
9 make/vpath/Makefile
@@ -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
View
5 make/vpath/include/hello.h
@@ -0,0 +1,5 @@
+#ifndef _HELLO_H_
+#define _HELLO_H_
+
+extern void say_hello();
+#endif
View
5 make/vpath/src/hello.c
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+say_hello() {
+ printf("Hello, world!");
+}
View
6 make/vpath/src/main.c
@@ -0,0 +1,6 @@
+#include <hello.h>
+
+int main() {
+ say_hello();
+ return 0;
+}

0 comments on commit b17e2c8

Please sign in to comment.
Something went wrong with that request. Please try again.