1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
[Template]
Name=empty-make
Description=Create an empty project with Make build system
Tags=Make;
[Input name]
Type=text
Title=Project Name
Subtitle=The name for your project which should not contain spaces
Validate=^[-\\w0-9]+$
[Input license]
Type=license
Title=License
Default=GPL-3.0-or-later
[Input language]
Type=language
Title=Language
Choices=c;cpp;
Default=c
[Input git]
Type=switch
Title=Version Control
Default=true
```
dirname = name
exec_name = name
```
```{{dirname}}/Makefile
all: {{exec_name}}
{{if language.id == "c"}}
WARNINGS = -Wall
DEBUG = -ggdb -fno-omit-frame-pointer
OPTIMIZE = -O2
{{else if language.id == "cpp"}}
WARNINGS = -Wall -Weffc++ -Wextra -Wsign-conversion -pedantic-errors
DEBUG = -ggdb -fno-omit-frame-pointer
OPTIMIZE = -O2
STANDARD = -std=c++2a
{{end}}
{{if language.id == "c"}}
{{exec_name}}: Makefile main.c
$(CC) -o $@ $(WARNINGS) $(DEBUG) $(OPTIMIZE) main.c
{{else if language.id == "cpp"}}
{{exec_name}}: Makefile main.cpp
$(CXX) -o $@ $(WARNINGS) $(DEBUG) $(OPTIMIZE) $(STANDARD) main.cpp
{{end}}
clean:
rm -f {{exec_name}}
install:
echo "Installing is not supported"
run: {{exec_name}}
./{{exec_name}}
```
if language.id == "c"
```{{dirname}}/main.c
{{include "license.c"}}
#include <stdio.h>
#include <stdlib.h>
int
main (int argc,
char *argv[])
{
printf ("Hello, World!\n");
return EXIT_SUCCESS;
}
```
end
if language.id == "cpp"
```{{dirname}}/main.cpp
{{include "license.cpp"}}
#include <iostream>
#include <cstdlib>
int
main ()
{
std::cout << "Hello, World!\n";
return EXIT_SUCCESS;
}
```
end
```{{dirname}}/LICENSE
{{license.text}}
```
```{{dirname}}/.foundry/.gitignore
tmp/
user/
cache/
```
```{{dirname}}/.foundry/project/settings.keyfile
[project]
build-system='make'
default-license='{{license.id}}'
```
if git
{{dirname}}/.git/objects/
{{dirname}}/.git/refs/heads/
```{{dirname}}/.git/HEAD
ref: refs/heads/main
```
```{{dirname}}/.gitignore
*~
*.swp
{{exec_name}}
```
end
|