-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
46 lines (33 loc) · 849 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
PREFIX=/usr/local
DC=dmd
ifneq ($(findstring gdc,$(DC)),gdc)
RELEASEFLAGS=-O -release -boundscheck=off
endif
ifeq ($(findstring dmd,$(DC)),dmd)
DFLAGS=-betterC
DEBUGFLAGS=-debug
endif
ifeq ($(findstring gdc,$(DC)),gdc)
DEBUGFLAGS=-g -oddcpuid
RELEASEFLAGS=-O -frelease -fbounds-check=off -oddcpuid
endif
ifeq ($(findstring ldc,$(DC)),ldc)
DEBUGFLAGS=-g
endif
.PHONY: clean install uninstall debug release
default: debug
debug:
$(MAKE) ddcpuid DFLAGS="$(DFLAGS) $(DEBUGFLAGS)"
release:
$(MAKE) ddcpuid DFLAGS="$(DFLAGS) $(RELEASEFLAGS)"
clean:
rm -fv ddcpuid.o
rm -fv ddcpuid
install: ddcpuid
cp ddcpuid $(PREFIX)/bin
cp manuals/ddcpuid.1 $(PREFIX)/share/man/man1
uninstall:
rm -fv $(PREFIX)/bin/ddcpuid
rm -fv $(PREFIX)/share/man/man1/ddcpuid.1
ddcpuid: src/ddcpuid.d src/main.d
$(DC) $(DFLAGS) src/ddcpuid.d src/main.d