xref: /linux/tools/thermal/thermal-engine/Makefile (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1# SPDX-License-Identifier: GPL-2.0
2# Makefile for thermal tools
3
4ifeq ($(srctree),)
5srctree := $(patsubst %/,%,$(dir $(CURDIR)))
6srctree := $(patsubst %/,%,$(dir $(srctree)))
7srctree := $(patsubst %/,%,$(dir $(srctree)))
8# $(info Determined 'srctree' to be $(srctree))
9endif
10
11CFLAGS = -Wall -Wextra
12CFLAGS += -I$(srctree)/tools/thermal/lib
13CFLAGS += -I$(srctree)/tools/lib/thermal/include
14
15LDFLAGS = -L$(srctree)/tools/thermal/lib
16LDFLAGS += -L$(srctree)/tools/lib/thermal
17LDFLAGS += -lthermal_tools
18LDFLAGS += -lthermal
19LDFLAGS += -lconfig
20LDFLAGS += -lnl-genl-3 -lnl-3
21
22VERSION = 0.0.1
23
24all: thermal-engine
25%: %.c
26	$(CC) $(CFLAGS) -D VERSION=\"$(VERSION)\" -o $@ $^ $(LDFLAGS)
27clean:
28	$(RM) thermal-engine
29