aboutsummaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2015-12-04 11:57:10 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2015-12-04 11:57:10 +0900
commitb1cc4492f5c70343637c19774f26a3ed1e6bb096 (patch)
treeb4877b18f84f46ab9a5ab61cd15aea776ed75ae1 /template
parent3ebc8dad590e40ec27b9570059675e557544829d (diff)
downloadvim-sonictemplate-b1cc4492f5c70343637c19774f26a3ed1e6bb096.tar.gz
vim-sonictemplate-b1cc4492f5c70343637c19774f26a3ed1e6bb096.tar.bz2
vim-sonictemplate-b1cc4492f5c70343637c19774f26a3ed1e6bb096.zip
fix template of Makefile
Diffstat (limited to 'template')
-rw-r--r--template/make/base-c.mak5
-rw-r--r--template/make/base-cpp.mak25
2 files changed, 29 insertions, 1 deletions
diff --git a/template/make/base-c.mak b/template/make/base-c.mak
index cab0056..48c2777 100644
--- a/template/make/base-c.mak
+++ b/template/make/base-c.mak
@@ -5,7 +5,10 @@ OBJS = $(subst .c,.o,$(SRCS))
CFLAGS =
LIBS =
-TARGET = {{_expr_:expand('%:p:h:t') . (has('win32')||has('win64')?'.exe':'')}}
+TARGET = {{_expr_:expand('%:p:h:t')}}
+ifeq ($(OS),Windows_NT)
+TARGET := $(TARGET).exe
+endif
all : $(TARGET)
diff --git a/template/make/base-cpp.mak b/template/make/base-cpp.mak
new file mode 100644
index 0000000..07e2269
--- /dev/null
+++ b/template/make/base-cpp.mak
@@ -0,0 +1,25 @@
+SRCS = \
+{{_expr_:join(map(split(glob('*.cpp'),"\n")+split(glob('*.cxx'),"\n"),'"\t".substitute(v:val,"\\","/","g")')," \\\n")}}
+
+OBJS = $(subst .cxx,.o,$(subst .cpp,.o,$(SRCS)))
+
+CFLAGS =
+LIBS =
+TARGET = {{_expr_:expand('%:p:h:t')}}
+ifeq ($(OS),Windows_NT)
+TARGET := $(TARGET).exe
+endif
+
+all : $(TARGET)
+
+$(TARGET) : $(OBJS)
+ g++ -std=c++14 -o $@ $(OBJS) $(LIBS)
+
+.cxx.o :
+ g++ -std=c++14 -c $(CFLAGS) -I. $< -o $@
+
+.cpp.o :
+ g++ -std=c++14 -c $(CFLAGS) -I. $< -o $@
+
+clean :
+ rm -f *.o $(TARGET)