代码拉取完成,页面将自动刷新
# 文心一言生成的,我实在是没有精力写这些东西了
# 啊啊啊啊 啊啊啊啊啊
# 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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。