nstool/lib/libpolarssl/makefile

43 lines
939 B
Makefile
Raw Normal View History

2017-07-03 01:18:59 +10:00
# Sources
SRC_DIR = source
2018-08-07 13:28:06 +08:00
OBJS = $(foreach dir,$(SRC_DIR), $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c)))
2017-07-03 01:18:59 +10:00
# External dependencies
2018-08-07 13:28:06 +08:00
INCS = -I"include"
2017-07-03 01:18:59 +10:00
# Compiler Settings
2018-03-17 15:59:38 +08:00
CFLAGS = -std=c11 $(INCS) -Wall -Wno-unused-value
ARFLAGS = cr -o
2017-07-03 01:18:59 +10:00
ifeq ($(OS),Windows_NT)
# Windows Only Flags/Libs
CC = x86_64-w64-mingw32-gcc
CXX = x86_64-w64-mingw32-g++
2018-03-17 15:59:38 +08:00
CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += -Wno-unused-but-set-variable
2017-07-03 01:18:59 +10:00
else
2018-03-17 15:59:38 +08:00
UNAME = $(shell uname -s)
ifeq ($(UNAME), Darwin)
# MacOS Only Flags/Libs
2018-08-07 13:28:06 +08:00
CFLAGS += -arch x86_64 -Wno-unused-private-field
CXXFLAGS += -arch x86_64 -Wno-unused-private-field
2018-03-17 15:59:38 +08:00
ARFLAGS = rc
else
# *nix Only Flags/Libs
CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += -Wno-unused-but-set-variable
endif
2017-07-03 01:18:59 +10:00
endif
# Output
OUTPUT = $(shell basename $(CURDIR)).a
2017-07-03 01:18:59 +10:00
main: build
rebuild: clean build
build: $(OBJS)
2018-08-07 13:28:06 +08:00
ar cr -o $(OUTPUT) $(OBJS)
2017-07-03 01:18:59 +10:00
clean:
rm -rf $(OUTPUT) $(OBJS)