Commit 1e219c0b authored by Bernhard Nortmann's avatar Bernhard Nortmann
Browse files

Makefile: Use `uname` for OS detection on *nix platforms


Signed-off-by: default avatarBernhard Nortmann <bernhard.nortmann@web.de>
parent 2f6e0697
......@@ -16,6 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Windows predefines OS in the environment (to "Windows_NT"), otherwise use uname
OS ?= $(shell uname)
CC ?= gcc
DEFAULT_CFLAGS := -std=c99
DEFAULT_CFLAGS += -Wall -Wextra -Wno-unused-result
......@@ -26,7 +29,7 @@ DEFAULT_CFLAGS += -D_POSIX_C_SOURCE=200112L
DEFAULT_CFLAGS += -D_BSD_SOURCE
# glibc 2.20+ also requires _DEFAULT_SOURCE
DEFAULT_CFLAGS += -D_DEFAULT_SOURCE
ifeq (NetBSD,$(OS))
ifeq ($(OS),NetBSD)
# add explicit _NETBSD_SOURCE, see https://github.com/linux-sunxi/sunxi-tools/pull/22
DEFAULT_CFLAGS += -D_NETBSD_SOURCE
endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment