better makefile
This commit is contained in:
parent
173291a378
commit
5bc5e85110
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -2,4 +2,5 @@
|
||||||
nimcache/
|
nimcache/
|
||||||
nimblecache/
|
nimblecache/
|
||||||
htmldocs/
|
htmldocs/
|
||||||
|
bin/
|
||||||
|
doc/
|
||||||
|
|
13
Makefile
13
Makefile
|
@ -1,16 +1,21 @@
|
||||||
BUILD_DIR := bin/
|
BUILD_DIR := bin/
|
||||||
SOURCE_DIR := src/
|
SRC_DIR := src/
|
||||||
|
DOC_DIR := doc/
|
||||||
|
DOC_TYPE ?= doc
|
||||||
|
|
||||||
all:
|
all:
|
||||||
nim compile --out:$(BUILD_DIR) $(SOURCE_DIR)*.nim
|
nim compile --out:$(BUILD_DIR) $(SRC_DIR)*.nim
|
||||||
|
|
||||||
|
doc:
|
||||||
|
nim $(DOC_TYPE) --outdir:$(DOC_DIR) $(SRC_DIR)*.nim
|
||||||
|
|
||||||
release:
|
release:
|
||||||
nim compile --define:release --out:$(BUILD_DIR) $(SOURCE_DIR)*.nim
|
nim compile --define:release --out:$(BUILD_DIR) $(SRC_DIR)*.nim
|
||||||
|
|
||||||
run:
|
run:
|
||||||
@$(BUILD_DIR)main
|
@$(BUILD_DIR)main
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -rf $(BUILD_DIR)
|
@rm -rf $(BUILD_DIR) $(DOC_DIR)
|
||||||
|
|
||||||
clear: clean
|
clear: clean
|
13
src/main.nim
13
src/main.nim
|
@ -1 +1,12 @@
|
||||||
echo "Hello, World!"
|
## This module is a sample.
|
||||||
|
|
||||||
|
import strutils
|
||||||
|
|
||||||
|
proc helloWorld*(times: int) =
|
||||||
|
## Takes an integer and outputs
|
||||||
|
## as many indented "hello world!"s
|
||||||
|
|
||||||
|
for i in 0 .. times-1:
|
||||||
|
echo "hello world!".indent(2) # using indent to avoid `UnusedImport`
|
||||||
|
|
||||||
|
helloWorld(5)
|
Loading…
Reference in a new issue