51 lines
1.2 KiB
Makefile
51 lines
1.2 KiB
Makefile
BUILD := $(shell date -u +%Y%m%d-%H%M%S)
|
|
OS := $(shell uname -s)
|
|
|
|
TOOLKIT = ../..
|
|
|
|
DIRECTORIES = \
|
|
$(TOOLKIT)/Common \
|
|
$(TOOLKIT)/KAIROS
|
|
|
|
ifeq ($(OS), Linux)
|
|
LIBRARIES += \
|
|
rt
|
|
DEPENDENCIES = \
|
|
openssl
|
|
endif
|
|
|
|
ifeq ($(OS), Darwin)
|
|
CFLAGS += \
|
|
-Wno-deprecated-declarations \
|
|
-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/
|
|
LIBRARIES += \
|
|
crypto
|
|
endif
|
|
|
|
OBJECTS = \
|
|
CronosAgent.o
|
|
|
|
FLAGS := -g -fno-omit-frame-pointer -O3 -MMD $(foreach directory, $(DIRECTORIES), -I$(directory)) -DBUILD=\"$(BUILD)\"
|
|
LIBS := -lstdc++ $(foreach library, $(LIBRARIES), -l$(library))
|
|
|
|
CC = gcc
|
|
CFLAGS += $(FLAGS) -std=gnu99
|
|
|
|
ifeq ($(OS), Linux)
|
|
FLAGS += $(shell pkg-config --cflags $(DEPENDENCIES)) -rdynamic
|
|
LIBS += $(shell pkg-config --libs $(DEPENDENCIES))
|
|
endif
|
|
|
|
all: build
|
|
|
|
build: $(PREREQUISITES) $(OBJECTS)
|
|
$(CC) $(OBJECTS) $(FLAGS) $(LIBS) -o cronosagent
|
|
|
|
clean:
|
|
rm -f $(PREREQUISITES) $(OBJECTS) cronosagent
|
|
rm -f *.d $(TOOLKIT)/*/*.d
|
|
|
|
version:
|
|
echo "#define VERSION $(shell svn info | grep -E "^Revision:" | grep -o -E "[0-9]+")" > Version.h
|
|
|
|
.PHONY: all build clean install
|