1 Star 0 Fork 0

梅花三弄再回首/smbus-cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
# 文心一言生成的,我实在是没有精力写这些东西了
# 啊啊啊啊 啊啊啊啊啊
# Compiler
CXX = g++
# Compiler flags
CXXFLAGS = -Wall -std=c++11 -I. -li2c
# Source files
SRCS = SMBus.cpp PCF8591_test.cpp
# Object files
OBJS = $(SRCS:.cpp=.o)
# Static library
STATIC_LIB = libsmbus-cpp.a
# Test executable
TEST_EXEC = test
# Target rules
all: $(STATIC_LIB)
# Rule to create static library
$(STATIC_LIB): SMBus.o
@echo "Creating static library $(STATIC_LIB)"
@ar rcs $@ SMBus.o
# Rule to build test executable
test: $(STATIC_LIB) PCF8591_test.o
@echo "Building test executable $(TEST_EXEC)"
@$(CXX) $(CXXFLAGS) -o $(TEST_EXEC) PCF8591_test.o -L. -lsmbus
# Rule to create object files
%.o: %.cpp
@echo "Compiling $<"
@$(CXX) $(CXXFLAGS) -c $< -o $@
# Install rule (copies the library to /usr/local/lib and the header to /usr/local/include)
install: $(STATIC_LIB)
@echo "Installing $(STATIC_LIB) to /usr/local/lib"
@sudo cp $(STATIC_LIB) /usr/local/lib/
@echo "Installing SMBus.h to /usr/local/include"
@sudo cp SMBus.h /usr/local/include/
# Clean rule
clean:
@echo "Cleaning up..."
@rm -f $(OBJS) $(STATIC_LIB) $(TEST_EXEC)
# Default target
.PHONY: all test install clean
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/PlumBlossomMaid/smbus-cpp.git
git@gitee.com:PlumBlossomMaid/smbus-cpp.git
PlumBlossomMaid
smbus-cpp
smbus-cpp
master

搜索帮助