-
Notifications
You must be signed in to change notification settings - Fork 133
/
Makefile
70 lines (66 loc) · 1.69 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
ifeq ($(OS),Windows_NT)
# Need to figure out if Cygwin/Mingw is installed
SYS := $(shell gcc -dumpmachine)
ifeq ($(findstring cygwin, $(SYS)),cygwin)
ifeq ($(findstring x86_64, $(SYS)),x86_64)
PLATFORM = cygwin64
else
PLATFORM = cygwin
endif
endif
ifeq ($(findstring msys, $(SYS)),msys)
ifeq ($(findstring x86_64, $(SYS)),x86_64)
PLATFORM = cygwin64
else
PLATFORM = cygwin
endif
endif
ifeq ($(findstring mingw, $(SYS)),mingw)
ifeq ($(findstring x86_64, $(SYS)),x86_64)
PLATFORM = mingw64
else
PLATFORM = mingw32
endif
endif
else
# Grab the output of `uname -s` and switch to set the platform
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
PLATFORM = unix
endif
ifeq ($(UNAME_S),GNU)
# GNU/Hurd
PLATFORM = unix
endif
ifeq ($(UNAME_S),FreeBSD)
MAKE = make # BSD Make
PLATFORM = bsd
endif
ifeq ($(UNAME_S),DragonFly)
MAKE = make # BSD Make
PLATFORM = bsd
endif
ifeq ($(UNAME_S),NetBSD)
MAKE = make # BSD Make
PLATFORM = bsd
endif
ifeq ($(UNAME_S),OpenBSD)
MAKE = make # BSD Make
PLATFORM = bsd
endif
ifeq ($(UNAME_S),Darwin)
PLATFORM = mac
endif
ifeq ($(UNAME_S),SunOS)
PLATFORM = sunos
endif
endif
# Verify that the PLATFORM was detected
ifndef PLATFORM
$(error Autodetection of platform failed, please use appropriate .mak file)
endif
# Invoke the platform specific make files
all:
$(MAKE) -f make_$(PLATFORM).mak
clean:
$(MAKE) -f make_$(PLATFORM).mak clean