Support Compiling on MacOS

This commit is contained in:
jakcron 2018-03-17 15:59:38 +08:00
parent 20dfdc6b2a
commit 6630e108b2
4 changed files with 72 additions and 32 deletions

View file

@ -9,18 +9,28 @@ INCS = -I"include" -I"source/libpolarssl/include" $(foreach dep,$(DEPENDS), -I"$
# Compiler Settings # Compiler Settings
CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-but-set-variable -Wno-unused-value CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value
CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-but-set-variable -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value
ARFLAGS = cr -o
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
# Windows Only Flags/Libs # Windows Only Flags/Libs
CC = x86_64-w64-mingw32-gcc CC = x86_64-w64-mingw32-gcc
CXX = x86_64-w64-mingw32-g++ CXX = x86_64-w64-mingw32-g++
CFLAGS += CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += CXXFLAGS += -Wno-unused-but-set-variable
else else
# *nix Only Flags/Libs UNAME = $(shell uname -s)
CFLAGS += ifeq ($(UNAME), Darwin)
CXXFLAGS += # MacOS Only Flags/Libs
CFLAGS += -Wunused-private-field
CXXFLAGS += -Wunused-private-field
ARFLAGS = rc
else
# *nix Only Flags/Libs
CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += -Wno-unused-but-set-variable
endif
endif endif
# Output # Output
@ -31,7 +41,7 @@ main: build
rebuild: clean build rebuild: clean build
build: $(OBJS) build: $(OBJS)
ar cr -o $(OUTPUT) $(OBJS) ar $(ARFLAGS) $(OUTPUT) $(OBJS)
clean: clean:
rm -rf $(OUTPUT) $(OBJS) rm -rf $(OUTPUT) $(OBJS)

View file

@ -9,18 +9,28 @@ INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include")
# Compiler Settings # Compiler Settings
CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-but-set-variable -Wno-unused-value CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value
CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-but-set-variable -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value
ARFLAGS = cr -o
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
# Windows Only Flags/Libs # Windows Only Flags/Libs
CC = x86_64-w64-mingw32-gcc CC = x86_64-w64-mingw32-gcc
CXX = x86_64-w64-mingw32-g++ CXX = x86_64-w64-mingw32-g++
CFLAGS += CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += CXXFLAGS += -Wno-unused-but-set-variable
else else
# *nix Only Flags/Libs UNAME = $(shell uname -s)
CFLAGS += ifeq ($(UNAME), Darwin)
CXXFLAGS += # MacOS Only Flags/Libs
CFLAGS += -Wunused-private-field
CXXFLAGS += -Wunused-private-field
ARFLAGS = rc
else
# *nix Only Flags/Libs
CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += -Wno-unused-but-set-variable
endif
endif endif
# Output # Output
@ -31,7 +41,7 @@ main: build
rebuild: clean build rebuild: clean build
build: $(OBJS) build: $(OBJS)
ar cr -o $(OUTPUT) $(OBJS) ar $(ARFLAGS) $(OUTPUT) $(OBJS)
clean: clean:
rm -rf $(OUTPUT) $(OBJS) rm -rf $(OUTPUT) $(OBJS)

View file

@ -9,18 +9,28 @@ INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include")
# Compiler Settings # Compiler Settings
CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-but-set-variable -Wno-unused-value CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value
CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-but-set-variable -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value
ARFLAGS = cr -o
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
# Windows Only Flags/Libs # Windows Only Flags/Libs
CC = x86_64-w64-mingw32-gcc CC = x86_64-w64-mingw32-gcc
CXX = x86_64-w64-mingw32-g++ CXX = x86_64-w64-mingw32-g++
CFLAGS += CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += CXXFLAGS += -Wno-unused-but-set-variable
else else
# *nix Only Flags/Libs UNAME = $(shell uname -s)
CFLAGS += ifeq ($(UNAME), Darwin)
CXXFLAGS += # MacOS Only Flags/Libs
CFLAGS += -Wunused-private-field
CXXFLAGS += -Wunused-private-field
ARFLAGS = rc
else
# *nix Only Flags/Libs
CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += -Wno-unused-but-set-variable
endif
endif endif
# Output # Output
@ -31,7 +41,7 @@ main: build
rebuild: clean build rebuild: clean build
build: $(OBJS) build: $(OBJS)
ar cr -o $(OUTPUT) $(OBJS) ar $(ARFLAGS) $(OUTPUT) $(OBJS)
clean: clean:
rm -rf $(OUTPUT) $(OBJS) rm -rf $(OUTPUT) $(OBJS)

View file

@ -9,18 +9,28 @@ INCS = -I"include" $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include")
# Compiler Settings # Compiler Settings
CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-but-set-variable -Wno-unused-value CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value
CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-but-set-variable -Wno-unused-value CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value
ARFLAGS = cr -o
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
# Windows Only Flags/Libs # Windows Only Flags/Libs
CC = x86_64-w64-mingw32-gcc CC = x86_64-w64-mingw32-gcc
CXX = x86_64-w64-mingw32-g++ CXX = x86_64-w64-mingw32-g++
CFLAGS += CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += CXXFLAGS += -Wno-unused-but-set-variable
else else
# *nix Only Flags/Libs UNAME = $(shell uname -s)
CFLAGS += ifeq ($(UNAME), Darwin)
CXXFLAGS += # MacOS Only Flags/Libs
CFLAGS += -Wunused-private-field
CXXFLAGS += -Wunused-private-field
ARFLAGS = rc
else
# *nix Only Flags/Libs
CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += -Wno-unused-but-set-variable
endif
endif endif
# Output # Output
@ -31,7 +41,7 @@ main: build
rebuild: clean build rebuild: clean build
build: $(OBJS) build: $(OBJS)
ar cr -o $(OUTPUT) $(OBJS) ar $(ARFLAGS) $(OUTPUT) $(OBJS)
clean: clean:
rm -rf $(OUTPUT) $(OBJS) rm -rf $(OUTPUT) $(OBJS)