nstool/programs/tiktool/makefile

47 lines
1.2 KiB
Makefile
Raw Normal View History

2017-07-22 08:59:06 +00:00
# Sources
SRC_DIR = source
2017-07-22 08:59:06 +00:00
OBJS = $(foreach dir,$(SRC_DIR),$(subst .cpp,.o,$(wildcard $(dir)/*.cpp))) $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c)))
# External dependencies
2017-07-22 08:59:06 +00:00
DEPENDS = es crypto fnd
LIB_DIR = ../../lib
LIBS = $(foreach dep,$(DEPENDS), -L"$(LIB_DIR)/lib$(dep)" -l$(dep))
INCS = $(foreach dep,$(DEPENDS), -I"$(LIB_DIR)/lib$(dep)/include")
2017-07-22 08:59:06 +00:00
BIN_DIR = bin
OUTPUT = $(BIN_DIR)/$(shell basename $(CURDIR))
2017-07-22 08:59:06 +00:00
# Compiler Settings
2018-04-07 07:57:04 +00:00
CXXFLAGS = -std=c++11 $(INCS) -D__STDC_FORMAT_MACROS -Wall -Wno-unused-value
2017-07-22 08:59:06 +00:00
ifeq ($(OS),Windows_NT)
# Windows Only Flags/Libs
CC = x86_64-w64-mingw32-gcc
CXX = x86_64-w64-mingw32-g++
2018-04-07 07:57:04 +00:00
CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += -Wno-unused-but-set-variable
2017-07-22 08:59:06 +00:00
LIBS += -static
else
2018-04-07 07:57:04 +00:00
UNAME = $(shell uname -s)
ifeq ($(UNAME), Darwin)
# MacOS Only Flags/Libs
CFLAGS += -Wno-unused-private-field
CXXFLAGS += -Wno-unused-private-field
LIBS +=
else
# *nix Only Flags/Libs
CFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += -Wno-unused-but-set-variable
LIBS +=
endif
2017-07-22 08:59:06 +00:00
endif
all: build
rebuild: clean build
build: $(OBJS)
mkdir -p $(BIN_DIR)
2017-07-22 08:59:06 +00:00
$(CXX) $(OBJS) $(LIBS) -o $(OUTPUT)
clean:
rm -rf $(OBJS) $(OUTPUT) $(BIN_DIR)