forked from enigma-dev/enigma-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.mk
68 lines (60 loc) · 1.46 KB
/
Config.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
GCCVER := $(shell gcc -dumpversion | cut -c 1)
OS := $(shell uname -s)
# Determine whether Unix-based
ifeq ($(OS), Darwin)
UNIX_BASED := true
else ifeq ($(OS), Linux)
UNIX_BASED := true
else ifeq ($(OS), FreeBSD)
UNIX_BASED := true
else ifeq ($(OS), DragonFly)
UNIX_BASED := true
else
UNIX_BASED := false
endif
# Determine current platform
ifeq ($(OS), Darwin)
PLATFORM := Cocoa
MKDIR := mkdir
LIB_PFX := lib
LIB_EXT := .dylib
BIN_EXT :=
else ifeq ($(UNIX_BASED), true)
PLATFORM := xlib
MKDIR := mkdir
LIB_PFX := lib
LIB_EXT := .so
BIN_EXT :=
else
PLATFORM := Win32
MKDIR := mkdir.exe
LIB_PFX := lib
LIB_EXT := .dll
BIN_EXT := .exe
endif
# Global g++ flags
CXXFLAGS := -std=c++17 -Wall -Wextra -Wpedantic -g -I.
LDFLAGS := -g
# macOS brew include and lib folders
ifeq ($(OS), Darwin)
CXXFLAGS += -I/usr/local/include
CFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
endif
# FreeBSD include and lib folders
ifeq ($(OS), FreeBSD)
CXXFLAGS += -I/usr/local/include
CFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
endif
# DragonFlyBSD include and lib folders
ifeq ($(OS), DragonFly)
CXXFLAGS += -I/usr/local/include
CFLAGS += -I/usr/local/include
LDFLAGS += -L/usr/local/lib
endif
# These will be relative to the file that includes this Makefile
SRC_DIR := .
OBJ_DIR := .eobjs
# This implements a recursive wildcard allowing us to iterate in subdirs
rwildcard=$(wildcard $1/$2) $(foreach d,$(wildcard $1/*),$(call rwildcard,$d,$2))