summaryrefslogtreecommitdiff
path: root/Makefile
blob: 5e85957d83db7691f61674500476a40a6e3a78a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

SRC_DIR = src
BUILD_DIR = build
OBJ_DIR = $(BUILD_DIR)/artifacts

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 -o $(BUILD_DIR)/artifacts/$@ $<

build_dir:
	mkdir -p $(BUILD_DIR)
	mkdir -p $(OBJ_DIR)