alertik/Makefile
Davidson Francis 0294051aae Rework logging
2024-07-15 22:47:57 -03:00

40 lines
879 B
Makefile

#
# Alertik: a tiny 'syslog' server & notification tool for Mikrotik routers.
# This is free and unencumbered software released into the public domain.
#
CC ?= cc
CFLAGS += -Wall -Wextra
LDLIBS += -pthread -lcurl
STRIP = strip
VERSION = v0.1
OBJS = alertik.o events.o env_events.o notifiers.o log.o
ifeq ($(LOG_FILE),yes)
CFLAGS += -DUSE_FILE_AS_LOG
endif
# We're cross-compiling?
ifneq ($(CROSS),)
CC = $(CROSS)-linux-musleabi-gcc
STRIP = $(CROSS)-linux-musleabi-strip
ifeq ($(LOG_FILE),)
CFLAGS += -DUSE_FILE_AS_LOG # We don't have stdout...
endif
LDLIBS += -lbearssl
LDFLAGS += -no-pie --static
endif
GIT_HASH=$(shell git rev-parse --short HEAD 2>/dev/null || echo '$(VERSION)')
CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\"
.PHONY: all clean
all: alertik Makefile
$(STRIP) --strip-all alertik
alertik: $(OBJS)
clean:
rm -f $(OBJS) alertik