2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-11-28 08:43:26 +00:00
rules_foreign_cc/examples/make_simple/code/Makefile

23 lines
602 B
Makefile
Raw Normal View History

BUILD_DIR=build-out
UNAME:=$(shell uname)
ifneq (,$(findstring NT, $(UNAME)))
# If Windows
CXXFLAGS := $(CXXFLAGS) /MD
else
CXXFLAGS := $(CXXFLAGS) -fPIC
endif
default all $(BUILD_DIR)/lib/liba.a: liba.cpp liba.h
rm -rf $(BUILD_DIR)/lib
mkdir -p $(BUILD_DIR)/lib
$(CXX_WRAPPER) $(CXXFLAGS) -o $(BUILD_DIR)/lib/liba.o -c liba.cpp
ar rcs $(BUILD_DIR)/lib/liba.a $(BUILD_DIR)/lib/liba.o
install: $(BUILD_DIR)/lib/liba.a
mkdir -p $(PREFIX)/lib $(PREFIX)/include $(PREFIX)/share
cp -rpv $(BUILD_DIR)/lib $(PREFIX)
cp -p liba.h $(PREFIX)/include
cp $(README_DIR)/README.md $(PREFIX)/share/