aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2013-05-08 20:18:08 +0900
committermattn <mattn.jp@gmail.com>2013-05-08 20:18:08 +0900
commit4f0daba2cbb22736eeefdf2ec48bfa5471c24429 (patch)
tree8a25993b42f04a902193a0d7004c04921da2dc4c
parentd344e6389eccb0bfb3e4f00074f3815b627a5b52 (diff)
downloadvim-sonictemplate-4f0daba2cbb22736eeefdf2ec48bfa5471c24429.tar.gz
vim-sonictemplate-4f0daba2cbb22736eeefdf2ec48bfa5471c24429.tar.bz2
vim-sonictemplate-4f0daba2cbb22736eeefdf2ec48bfa5471c24429.zip
Add template for Makefile
-rw-r--r--template/make/base-c19
1 files changed, 19 insertions, 0 deletions
diff --git a/template/make/base-c b/template/make/base-c
new file mode 100644
index 0000000..cab0056
--- /dev/null
+++ b/template/make/base-c
@@ -0,0 +1,19 @@
+SRCS = \
+{{_expr_:join(map(split(glob('*.c'),"\n"),'"\t".substitute(v:val,"\\","/","g")')," \\\n")}}
+
+OBJS = $(subst .c,.o,$(SRCS))
+
+CFLAGS =
+LIBS =
+TARGET = {{_expr_:expand('%:p:h:t') . (has('win32')||has('win64')?'.exe':'')}}
+
+all : $(TARGET)
+
+$(TARGET) : $(OBJS)
+ gcc -o $@ $(OBJS) $(LIBS)
+
+.c.o :
+ gcc -c $(CFLAGS) -I. $< -o $@
+
+clean :
+ rm -f *.o $(TARGET)