diff options
Diffstat (limited to 'template')
-rw-r--r-- | template/make/base-c | 19 |
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) |