Initial import
This commit is contained in:
commit
12ffb10726
7 changed files with 795 additions and 0 deletions
74
Makefile
Normal file
74
Makefile
Normal file
|
@ -0,0 +1,74 @@
|
|||
BUILD := $(shell date -u +%Y%m%d-%H%M%S)
|
||||
OS := $(shell uname -s)
|
||||
|
||||
PREFIX = $(DESTDIR)/opt/TellusAgent
|
||||
TOOLKIT = ../..
|
||||
|
||||
DIRECTORIES = \
|
||||
$(TOOLKIT)/Common \
|
||||
$(TOOLKIT)/Rewind
|
||||
|
||||
ifeq ($(OS), Linux)
|
||||
FLAGS += -rdynamic
|
||||
KIND := $(shell grep -E "^6.0" /etc/debian_version > /dev/null ; echo $?)
|
||||
ifneq ($(KIND), 0)
|
||||
LIBRARIES += rt
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OS), Darwin)
|
||||
FLAGS += -Wno-deprecated-declarations
|
||||
endif
|
||||
|
||||
OBJECTS = \
|
||||
TellusAgent.o
|
||||
|
||||
FLAGS += -g -fno-omit-frame-pointer -O3 -MMD $(foreach directory, $(DIRECTORIES), -I$(directory)) -DBUILD=\"$(BUILD)\"
|
||||
LIBS += $(foreach library, $(LIBRARIES), -l$(library))
|
||||
|
||||
CC = gcc
|
||||
CFLAGS += $(FLAGS) -std=gnu99
|
||||
|
||||
ifneq ($(strip $(DEPENDENCIES)),)
|
||||
FLAGS += $(shell pkg-config --cflags $(DEPENDENCIES))
|
||||
LIBS += $(shell pkg-config --libs $(DEPENDENCIES))
|
||||
endif
|
||||
|
||||
all: build
|
||||
|
||||
build: $(PREREQUISITES) $(OBJECTS)
|
||||
$(CC) $(OBJECTS) $(FLAGS) $(LIBS) -o tellusagent
|
||||
|
||||
install:
|
||||
install -D -d $(PREFIX)
|
||||
install -o root -g root tellusagent $(PREFIX)
|
||||
install -o root -g root tellusagent.sh $(PREFIX)
|
||||
install -o root -g root tellusagent.conf $(PREFIX)
|
||||
ifeq ($(OS), Linux)
|
||||
install -o root -g root tellusagent-init $(PREFIX)
|
||||
install -m 644 -o root -g root tellusagent-monit $(PREFIX)
|
||||
install -m 644 -o root -g root tellusagent.service $(PREFIX)
|
||||
endif
|
||||
ifeq ($(OS), Darwin)
|
||||
install -m 644 -o root -g root tellusagent.plist $(DESTDIR)/Library/LaunchDaemons
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -f $(PREREQUISITES) $(OBJECTS) tellusagent
|
||||
rm -f *.d $(TOOLKIT)/*/*.d
|
||||
|
||||
version:
|
||||
echo "#define VERSION $(shell date -u +%Y%m%d)" > Version.h
|
||||
|
||||
debian-package:
|
||||
./UpdateLog.sh
|
||||
ifdef ARCH
|
||||
dpkg-buildpackage -b -a$(ARCH) -tc
|
||||
else
|
||||
dpkg-buildpackage -b -tc
|
||||
endif
|
||||
|
||||
macos-archive: build
|
||||
zip ../TellusAgent-macOS.zip tellusagent tellusagent.sh tellusagent.conf tellusagent.plist
|
||||
|
||||
.PHONY: all build clean install
|
Loading…
Add table
Add a link
Reference in a new issue