xref: /openbmc/linux/tools/thermal/tmon/Makefile (revision 94f69966)
194f69966SJacob PanVERSION = 1.0
294f69966SJacob Pan
394f69966SJacob PanBINDIR=usr/bin
494f69966SJacob PanWARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
594f69966SJacob PanCFLAGS= -O1 ${WARNFLAGS} -fstack-protector
694f69966SJacob PanCC=gcc
794f69966SJacob Pan
894f69966SJacob PanCFLAGS+=-D VERSION=\"$(VERSION)\"
994f69966SJacob PanLDFLAGS+=
1094f69966SJacob PanTARGET=tmon
1194f69966SJacob Pan
1294f69966SJacob PanINSTALL_PROGRAM=install -m 755 -p
1394f69966SJacob PanDEL_FILE=rm -f
1494f69966SJacob Pan
1594f69966SJacob PanINSTALL_CONFIGFILE=install -m 644 -p
1694f69966SJacob PanCONFIG_FILE=
1794f69966SJacob PanCONFIG_PATH=
1894f69966SJacob Pan
1994f69966SJacob Pan
2094f69966SJacob PanOBJS = tmon.o tui.o sysfs.o pid.o
2194f69966SJacob PanOBJS +=
2294f69966SJacob Pan
2394f69966SJacob Pantmon: $(OBJS) Makefile tmon.h
2494f69966SJacob Pan	$(CC) ${CFLAGS} $(LDFLAGS) $(OBJS)  -o $(TARGET) -lm -lpanel -lncursesw  -lpthread
2594f69966SJacob Pan
2694f69966SJacob Panvalgrind: tmon
2794f69966SJacob Pan	 sudo valgrind -v --track-origins=yes --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes ./$(TARGET)  1> /dev/null
2894f69966SJacob Pan
2994f69966SJacob Paninstall:
3094f69966SJacob Pan	- mkdir -p $(INSTALL_ROOT)/$(BINDIR)
3194f69966SJacob Pan	- $(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)"
3294f69966SJacob Pan	- mkdir -p $(INSTALL_ROOT)/$(CONFIG_PATH)
3394f69966SJacob Pan	- $(INSTALL_CONFIGFILE) "$(CONFIG_FILE)" "$(INSTALL_ROOT)/$(CONFIG_PATH)"
3494f69966SJacob Pan
3594f69966SJacob Panuninstall:
3694f69966SJacob Pan	$(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)"
3794f69966SJacob Pan	$(CONFIG_FILE) "$(CONFIG_PATH)"
3894f69966SJacob Pan
3994f69966SJacob Pan
4094f69966SJacob Panclean:
4194f69966SJacob Pan	find . -name "*.o" | xargs $(DEL_FILE)
4294f69966SJacob Pan	rm -f $(TARGET)
4394f69966SJacob Pan
4494f69966SJacob Pandist:
4594f69966SJacob Pan	git tag v$(VERSION)
4694f69966SJacob Pan	git archive --format=tar --prefix="$(TARGET)-$(VERSION)/" v$(VERSION) | \
4794f69966SJacob Pan		gzip > $(TARGET)-$(VERSION).tar.gz
48