-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (34 loc) · 931 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
ifeq ($(OS),Windows_NT)
# Fail if this is a windows platform
$(error Windows is not supported by this makefile, please use appropriate .mak file)
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),FreeBSD)
PLATFORM = unix
endif
ifeq ($(UNAME_S),NetBSD)
PLATFORM = unix
endif
ifeq ($(UNAME_S),OpenBSD)
PLATFORM = unix
endif
ifeq ($(UNAME_S),Darwin)
PLATFORM = mac
endif
ifeq ($(UNAME_S),SunOS)
PLATFORM = sunos
endif
# Verify that the PLATFORM was detected
ifndef PLATFORM
$(error Autodetection of platform failed, please use appropriate .mak file)
endif
endif
# Invoke the platform specific make files
all:
$(MAKE) -f make_$(PLATFORM).mak
clean:
$(MAKE) -f make_$(PLATFORM).mak clean