nstool/lib/libcrypto/makefile

45 lines
1 KiB
Makefile
Raw Normal View History

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