From 1b6b485858dd883064e11313711df3658e6e5bca Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Wed, 1 May 2024 01:36:15 -0400 Subject: Link libopensmarts --- Makefile | 21 +++++++++++++++++++++ build/artifacts/main.o | Bin 0 -> 1440 bytes build/osm-thermald | Bin 0 -> 20352 bytes log | 4 ++++ src/main.c | 13 +++++++++++++ 5 files changed, 38 insertions(+) create mode 100644 Makefile create mode 100644 build/artifacts/main.o create mode 100755 build/osm-thermald create mode 100644 log create mode 100644 src/main.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b3ce19a --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ + +SRC_DIR = src +BUILD_DIR = build +OBJ_DIR = $(BUILD_DIR)/artifacts +INCLUDE_DIR = ./include + +SRCS = $(notdir $(wildcard $(SRC_DIR)/*.c)) +OBJS = $(addsuffix .o, $(basename $(SRCS))) + +CFLAGS ?= -Werror -Wall + +build: build_dir $(OBJS) + $(CC) -lopensmarts -o $(BUILD_DIR)/osm-thermald $(addprefix $(OBJ_DIR)/, $(OBJS)) + +%.o: $(SRC_DIR)/%.c + $(CC) $(CFLAGS) -c -I$(INCLUDE_DIR) -o $(BUILD_DIR)/artifacts/$@ $< + +build_dir: + mkdir -p $(BUILD_DIR) + mkdir -p $(OBJ_DIR) + diff --git a/build/artifacts/main.o b/build/artifacts/main.o new file mode 100644 index 0000000..5a4750b Binary files /dev/null and b/build/artifacts/main.o differ diff --git a/build/osm-thermald b/build/osm-thermald new file mode 100755 index 0000000..c61aa94 Binary files /dev/null and b/build/osm-thermald differ diff --git a/log b/log new file mode 100644 index 0000000..1f0b513 --- /dev/null +++ b/log @@ -0,0 +1,4 @@ +bind: Address already in use +bind: Success +-1 /run/osm/onboard/0 +Bound! diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..8b9582c --- /dev/null +++ b/src/main.c @@ -0,0 +1,13 @@ +#include +#include +#include + +int main(int argc, char **argv) +{ + int fd = osm_open_onboard(NULL); + if (fd >= 0) + { + close(fd); + } + return 0; +} -- cgit v1.2.3