| WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int |
| CFLAGS+= -O1 ${WARNFLAGS} -fstack-protector |
| CFLAGS+=-D VERSION=\"$(VERSION)\" |
| INSTALL_PROGRAM=install -m 755 -p |
| INSTALL_CONFIGFILE=install -m 644 -p |
| # Static builds might require -ltinfo, for instance |
| ifneq ($(findstring -static, $(LDFLAGS)),) |
| TMON_LIBS += $(shell pkg-config --libs $(STATIC) panelw ncursesw 2> /dev/null || \ |
| pkg-config --libs $(STATIC) panel ncurses 2> /dev/null || \ |
| OBJS = tmon.o tui.o sysfs.o pid.o |
| tmon: $(OBJS) Makefile tmon.h |
| $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $(TARGET) $(TMON_LIBS) |
| sudo valgrind -v --track-origins=yes --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes ./$(TARGET) 1> /dev/null |
| - mkdir -p $(INSTALL_ROOT)/$(BINDIR) |
| - $(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)" |
| - mkdir -p $(INSTALL_ROOT)/$(CONFIG_PATH) |
| - $(INSTALL_CONFIGFILE) "$(CONFIG_FILE)" "$(INSTALL_ROOT)/$(CONFIG_PATH)" |
| $(DEL_FILE) "$(INSTALL_ROOT)/$(BINDIR)/$(TARGET)" |
| $(CONFIG_FILE) "$(CONFIG_PATH)" |
| find . -name "*.o" | xargs $(DEL_FILE) |
| git archive --format=tar --prefix="$(TARGET)-$(VERSION)/" v$(VERSION) | \ |
| gzip > $(TARGET)-$(VERSION).tar.gz |