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 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Makefile (limited to 'Makefile') 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) + -- cgit v1.2.3