Skip to content

Commit

Permalink
add templates for Makefile, CMakeLists.txt, main.c and main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
tibabit committed Oct 11, 2019
1 parent 3c873a2 commit c667684
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
10 changes: 10 additions & 0 deletions templates/CMakeLists.txt.template
@@ -0,0 +1,10 @@
######################################################################
# @author : {{NAME}} ({{EMAIL}})
# @file : {{FILE}}
# @created : {{TIMESTAMP}}
######################################################################

cmake_minimum_required(VERSION 2.8)
project({{CURSOR}} C)

add_executable(main main.c)
27 changes: 27 additions & 0 deletions templates/Makefile.template
@@ -0,0 +1,27 @@
######################################################################
# @author : {{NAME}} ({{EMAIL}})
# @file : {{FILE}}
# @created : {{TIMESTAMP}}
######################################################################

IDIR =./include
CC=gcc
CFLAGS=-I$(IDIR)

ODIR=obj

LIBS=

_OBJ = main.o {{CURSOR}}
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))

$(ODIR)/%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)

main: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)

.PHONY: clean

clean:
rm -f $(ODIR)/*.o
13 changes: 13 additions & 0 deletions templates/main.c.template
@@ -0,0 +1,13 @@
/**
* @author : {{NAME}} ({{EMAIL}})
* @file : {{FILE}}
* @created : {{TIMESTAMP}}
*/

#include <stdio.h>

int main()
{
{{CURSOR}}
return 0;
}
13 changes: 13 additions & 0 deletions templates/main.cpp.template
@@ -0,0 +1,13 @@
/**
* @author : {{NAME}} ({{EMAIL}})
* @file : {{FILE}}
* @created : {{TIMESTAMP}}
*/

#include <iostream>

int main()
{
{{CURSOR}}
return 0;
}

0 comments on commit c667684

Please sign in to comment.