-
Notifications
You must be signed in to change notification settings - Fork 353
/
Makefile
30 lines (21 loc) · 793 Bytes
/
Makefile
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
vpath %.exe bin/
vpath %.dll bin/
vpath %.nim src/
#NIMFLAGS = -d=danger -d=mingw -d=strip --passc=-flto --passl=-flto --opt=size
NIMFLAGS = -d=debug -d=mingw --embedsrc=on --hints=on
SRCS_BINS = $(notdir $(wildcard src/*_bin.nim))
SRCS_LIBS = $(notdir $(wildcard src/*_lib.nim))
BINS = $(patsubst %.nim,%.exe,$(SRCS_BINS))
DLLS = $(patsubst %.nim,%.dll,$(SRCS_LIBS))
.PHONY: clean
default: build
build: $(BINS) $(DLLS)
rebuild: clean build
clean:
rm -rf bin/*.exe bin/*.dll
%.exe : %.nim
nim c $(NIMFLAGS) --app=console --cpu=amd64 --out=bin/$*_64.exe $<
#nim c $(NIMFLAGS) --app=console --cpu=i386 --out=bin/$*_32.exe $<
%.dll: %.nim
nim c $(NIMFLAGS) --app=lib --nomain --cpu=amd64 --out=bin/$*_64.dll $<
#nim c $(NIMFLAGS) --app=lib --nomain --cpu=i386 --out=bin/$*_32.dll $<