mirror of
https://github.com/jakcron/nstool
synced 2024-11-15 02:06:40 +00:00
Support Compiling on MacOS
This commit is contained in:
parent
20dfdc6b2a
commit
6630e108b2
4 changed files with 72 additions and 32 deletions
|
@ -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
|
||||||
|
UNAME = $(shell uname -s)
|
||||||
|
ifeq ($(UNAME), Darwin)
|
||||||
|
# MacOS Only Flags/Libs
|
||||||
|
CFLAGS += -Wunused-private-field
|
||||||
|
CXXFLAGS += -Wunused-private-field
|
||||||
|
ARFLAGS = rc
|
||||||
else
|
else
|
||||||
# *nix Only Flags/Libs
|
# *nix Only Flags/Libs
|
||||||
CFLAGS +=
|
CFLAGS += -Wno-unused-but-set-variable
|
||||||
CXXFLAGS +=
|
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)
|
|
@ -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
|
||||||
|
UNAME = $(shell uname -s)
|
||||||
|
ifeq ($(UNAME), Darwin)
|
||||||
|
# MacOS Only Flags/Libs
|
||||||
|
CFLAGS += -Wunused-private-field
|
||||||
|
CXXFLAGS += -Wunused-private-field
|
||||||
|
ARFLAGS = rc
|
||||||
else
|
else
|
||||||
# *nix Only Flags/Libs
|
# *nix Only Flags/Libs
|
||||||
CFLAGS +=
|
CFLAGS += -Wno-unused-but-set-variable
|
||||||
CXXFLAGS +=
|
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)
|
|
@ -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
|
||||||
|
UNAME = $(shell uname -s)
|
||||||
|
ifeq ($(UNAME), Darwin)
|
||||||
|
# MacOS Only Flags/Libs
|
||||||
|
CFLAGS += -Wunused-private-field
|
||||||
|
CXXFLAGS += -Wunused-private-field
|
||||||
|
ARFLAGS = rc
|
||||||
else
|
else
|
||||||
# *nix Only Flags/Libs
|
# *nix Only Flags/Libs
|
||||||
CFLAGS +=
|
CFLAGS += -Wno-unused-but-set-variable
|
||||||
CXXFLAGS +=
|
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)
|
|
@ -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
|
||||||
|
UNAME = $(shell uname -s)
|
||||||
|
ifeq ($(UNAME), Darwin)
|
||||||
|
# MacOS Only Flags/Libs
|
||||||
|
CFLAGS += -Wunused-private-field
|
||||||
|
CXXFLAGS += -Wunused-private-field
|
||||||
|
ARFLAGS = rc
|
||||||
else
|
else
|
||||||
# *nix Only Flags/Libs
|
# *nix Only Flags/Libs
|
||||||
CFLAGS +=
|
CFLAGS += -Wno-unused-but-set-variable
|
||||||
CXXFLAGS +=
|
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)
|
Loading…
Reference in a new issue