-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.common.mk
77 lines (61 loc) · 1.36 KB
/
makefile.common.mk
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
TARGET = $(notdir $(CURDIR))
#MAKEFLAGS += --no-print-directory
ifeq ($(OS),Windows_NT)
EXE = .exe
else
OPT += --passL:-lstdc++
endif
TARGET_EXE = $(TARGET)$(EXE)
.PHONY: clean run dll ver info build upx dupx
OPT += -d:strip
OPT += -o:$(TARGET_EXE)
#OPT += --listCmd
#OPT += --verbosity:2
all: build dll
SRC_MAIN ?= $(TARGET)
build:
$(PRE_CMD1)
nim c $(OPT) $(IMOPT) $(SRC_MAIN)
-$(AFTER_BUILD1)
win:
$(PRE_CMD1)
nim c $(OPT) $(IMOPT) -d:mingw --passL:-lstdc++ $(SRC_MAIN)
-$(AFTER_BUILD1)
clean:
@-rm -fr .nimcache
-rm -f $(TARGET_EXE)
@# Visual studio artifacts
@-rm -f $(TARGET).exp
@-rm -f $(TARGET).lib
@-rm -f $(TARGET).ilk
@-rm -f $(TARGET).pdb
run: all
@#nimble run --verbose
./$(TARGET_EXE)
info: dll
dll:
@echo
ifeq ($(OS),Windows_NT)
@#- ../../src/tools/vdd.exe $(TARGET_EXE)
@echo [Depending on dlls]
@-ldd $(TARGET_EXE) | grep -ivE "windows/(system|winsxs)" | sort | uniq
@#-ldd $(TARGET_EXE) | rg -ive "windows/(system|winsxs)" | sort | uniq
@#echo [cimgui.dll version]
@#-strings cimgui.dll | rg -ie "^\d\.\d\d\.\d" | uniq
else
@-ldd $(TARGET_EXE) | sort
endif
@echo
ver:
@# version check
@echo [$(TARGET).nimlbe]
-@rg -ie "version\s+=.+" $(TARGET).nimble
@echo [version.nims]
-@rg -ie "\d\.\d\.\d" version.nims
upx: all
upx --lzma $(TARGET_EXE)
dupx:
upx -d $(TARGET_EXE)
.PHONY: gen
gen:
nim c -r ../utils/genImPlotFuncs.nim