alertik/Makefile

40 lines
888 B
Makefile
Raw Normal View History

2024-05-29 02:06:56 +02:00
#
# 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
2024-05-31 01:49:35 +02:00
VERSION = v0.1
2024-07-17 03:34:38 +02:00
OBJS = alertik.o events.o env_events.o notifiers.o log.o syslog.o
2024-05-29 02:06:56 +02:00
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
2024-05-30 07:05:29 +02:00
ifeq ($(LOG_FILE),)
CFLAGS += -DUSE_FILE_AS_LOG # We don't have stdout...
endif
2024-05-29 02:06:56 +02:00
LDLIBS += -lbearssl
LDFLAGS += -no-pie --static
endif
2024-05-31 01:49:35 +02:00
GIT_HASH=$(shell git rev-parse --short HEAD 2>/dev/null || echo '$(VERSION)')
CFLAGS += -DGIT_HASH=\"$(GIT_HASH)\"
.PHONY: all clean
2024-05-29 02:06:56 +02:00
all: alertik Makefile
$(STRIP) --strip-all alertik
2024-07-16 03:16:27 +02:00
alertik: $(OBJS)
2024-05-29 02:06:56 +02:00
clean:
2024-07-16 03:16:27 +02:00
rm -f $(OBJS) alertik