better makefile
This commit is contained in:
parent
173291a378
commit
5bc5e85110
|
@ -2,4 +2,5 @@
|
|||
nimcache/
|
||||
nimblecache/
|
||||
htmldocs/
|
||||
|
||||
bin/
|
||||
doc/
|
||||
|
|
13
Makefile
13
Makefile
|
@ -1,16 +1,21 @@
|
|||
BUILD_DIR := bin/
|
||||
SOURCE_DIR := src/
|
||||
SRC_DIR := src/
|
||||
DOC_DIR := doc/
|
||||
DOC_TYPE ?= doc
|
||||
|
||||
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:
|
||||
nim compile --define:release --out:$(BUILD_DIR) $(SOURCE_DIR)*.nim
|
||||
nim compile --define:release --out:$(BUILD_DIR) $(SRC_DIR)*.nim
|
||||
|
||||
run:
|
||||
@$(BUILD_DIR)main
|
||||
|
||||
clean:
|
||||
@rm -rf $(BUILD_DIR)
|
||||
@rm -rf $(BUILD_DIR) $(DOC_DIR)
|
||||
|
||||
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 New Issue