X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=src%2FMakefile;h=fd31fd8691ba36242c6de85f5b04378181937398;hb=4b8ad1b3b464836eca2e876dd418a8e8d87bd721;hp=f0783e92d18ded0a2d1f4c35fb8d53fcc9e752d6;hpb=6f9f33a6a5c7d677b4f4464218c01580a391cf08;p=smdp.git diff --git a/src/Makefile b/src/Makefile index f0783e9..fd31fd8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ -# -# 1 # Makefile +# +# Makefile # Copyright (C) 2014 Michael Goehler # # This file is part of mdp. @@ -18,19 +18,29 @@ # along with this program. If not, see . # -SOURCES = $(wildcard *.c) -OBJECTS = $(SOURCES:.c=.o) +UNAME_S := $(shell uname -s 2>/dev/null || echo not) + +SOURCES = $(wildcard *.c) +OBJECTS = $(SOURCES:.c=.o) +CFLAGS ?= -O3 +CFLAGS += -Wall +CPPFLAGS += -I../include -CFLAGS = -O3 -Wall -I../include ifeq ($(DEBUG),1) -CFLAGS := -O0 -Wall -g -I../include + CFLAGS := -O0 -Wall -g endif -OSTYPE := $(shell uname -o) -ifeq (Windows_NT, $(OS)) -ifneq (Cygwin, $(OSTYPE)) -CFLAGS += -DWIN32=1 +ifeq ($(OS),Windows_NT) + ifeq (,$(findstring CYGWIN,$(UNAME_S))) + CPPFLAGS += -DWIN32 + endif endif + +ifeq ($(UNAME_S),Linux) + LSB_RELEASE := $(shell lsb_release -si 2>/dev/null || echo not) + ifneq ($(filter $(LSB_RELEASE),Debian Ubuntu LinuxMint CrunchBang),) + CPPFLAGS += -I/usr/include/ncursesw + endif endif all: $(OBJECTS)