Commit fe983171 authored by Deucе's avatar Deucе 👌🏾
Browse files

Move DEBUG and __unix__ stuff into Platform.gmake

This should be shared across all source dirs.
parent e80e80a0
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -41,4 +41,22 @@ ifeq ($(OS),$(shell uname))
  NATIVE	?= 1
 endif
 UNIXY		?= 1
 # NetBSD and Darwin don't define this themselves
 CFLAGS	+=	-D__unix__
endif

# Build types, debug and opt
ifdef DEBUG
 CFLAGS	+=	-g -O0 -Wall -pedantic -Wconversion -Wextra -Wno-format-truncation
 LDFLAGS +=	-g
else
 CFLAGS	+=	-Os -DNDEBUG -flto
 LDFLAGS +=	-Os -flto -fwhole-program
 ifeq ($(os),darwin)
  LDFLAGS +=	-Wl,-x,-dead_strip
 else
  LDFLAGS +=	-s
 endif
endif

CFLAGS	+=	-std=c17 -MMD -MP
+0 −22
Original line number Diff line number Diff line
@@ -13,12 +13,6 @@ ODOORS_LIB ?= $(ODOORS)libs-$(OS)/libODoors.a
CLANS_LIBS +=	$(ODOORS_LIB)
LDFLAGS	+=	-L$(ODOORS)libs-$(OS)

# Some platform-specific things...
ifdef UNIXY
 # NetBSD and Darwin don't define this themselves
 CFLAGS	+=	-D__unix__
endif

ifdef WIN
 # We won't be using the DLL
 CFLAGS	+=	-DOD_WIN32_STATIC
@@ -28,22 +22,6 @@ else
 CFLAGS	+=	-D_POSIX_C_SOURCE=200809L
endif

# Build types, debug and opt
ifdef DEBUG
 CFLAGS	+=	-g -O0 -Wall -pedantic -Wconversion -Wextra -Wno-format-truncation
 LDFLAGS +=	-g
else
 CFLAGS	+=	-Os -DNDEBUG -flto
 LDFLAGS +=	-Os -flto -fwhole-program
 ifeq ($(os),darwin)
  LDFLAGS +=	-Wl,-x,-dead_strip
 else
  LDFLAGS +=	-s
 endif
endif

CFLAGS	+=	-std=c17 -MMD -MP

#
# See convert.txt for more suggestions.