2019-11-26 18:13:54 +00:00
|
|
|
BUILD_DIR=build-out
|
2021-07-12 14:17:18 +00:00
|
|
|
|
|
|
|
UNAME:=$(shell uname)
|
|
|
|
|
|
|
|
ifneq (,$(findstring NT, $(UNAME)))
|
|
|
|
# If Windows
|
2021-11-27 15:52:54 +00:00
|
|
|
CXXFLAGS := $(CXXFLAGS) /MD
|
2021-07-12 14:17:18 +00:00
|
|
|
else
|
2021-11-27 15:52:54 +00:00
|
|
|
CXXFLAGS := $(CXXFLAGS) -fPIC
|
2021-07-12 14:17:18 +00:00
|
|
|
endif
|
|
|
|
|
2019-07-10 16:05:24 +00:00
|
|
|
default all $(BUILD_DIR)/lib/liba.a: liba.cpp liba.h
|
|
|
|
rm -rf $(BUILD_DIR)/lib
|
|
|
|
mkdir -p $(BUILD_DIR)/lib
|
2021-11-27 15:52:54 +00:00
|
|
|
$(CXX_WRAPPER) $(CXXFLAGS) -o $(BUILD_DIR)/lib/liba.o -c liba.cpp
|
2019-07-10 16:05:24 +00:00
|
|
|
ar rcs $(BUILD_DIR)/lib/liba.a $(BUILD_DIR)/lib/liba.o
|
|
|
|
|
|
|
|
install: $(BUILD_DIR)/lib/liba.a
|
2022-02-09 22:34:12 +00:00
|
|
|
mkdir -p $(PREFIX)/lib $(PREFIX)/include $(PREFIX)/share
|
2021-05-06 00:47:25 +00:00
|
|
|
cp -rpv $(BUILD_DIR)/lib $(PREFIX)
|
|
|
|
cp -p liba.h $(PREFIX)/include
|
2022-02-09 22:34:12 +00:00
|
|
|
cp $(README_DIR)/README.md $(PREFIX)/share/
|