2009-02-19 16:14:09 +00:00
|
|
|
##
|
|
|
|
## Makefile for uhub (Use GNU make)
|
2010-01-19 13:53:47 +00:00
|
|
|
## Copyright (C) 2007-2010, Jan Vidar Krey <janvidar@extatic.org>
|
2009-02-19 16:14:09 +00:00
|
|
|
#
|
|
|
|
|
2010-02-15 17:56:23 +00:00
|
|
|
-include Makefile.private
|
|
|
|
|
2009-02-19 16:14:09 +00:00
|
|
|
CC = gcc
|
|
|
|
LD := $(CC)
|
|
|
|
MV := mv
|
|
|
|
RANLIB := ranlib
|
|
|
|
CFLAGS += -pipe -Wall
|
2010-08-18 21:32:53 +00:00
|
|
|
USE_SSL ?= YES
|
2011-11-30 11:19:37 +00:00
|
|
|
USE_PLUGINS ?= YES
|
2009-02-19 16:14:09 +00:00
|
|
|
USE_BIGENDIAN ?= AUTO
|
|
|
|
BITS ?= AUTO
|
|
|
|
SILENT ?= YES
|
2009-03-16 16:36:28 +00:00
|
|
|
TERSE ?= NO
|
2009-03-16 21:49:55 +00:00
|
|
|
STACK_PROTECT ?= NO
|
2011-12-09 12:41:25 +00:00
|
|
|
NEED_LIBDL ?= NO
|
2009-02-19 16:14:09 +00:00
|
|
|
|
|
|
|
ifeq ($(OS), Windows_NT)
|
|
|
|
WINDOWS ?= YES
|
2010-01-28 00:29:34 +00:00
|
|
|
OPSYS ?= Windows
|
|
|
|
else
|
|
|
|
OPSYS ?= $(shell uname)
|
2009-02-19 16:14:09 +00:00
|
|
|
endif
|
|
|
|
|
2010-01-28 00:29:34 +00:00
|
|
|
ifeq ($(OPSYS),SunOS)
|
2009-08-06 21:15:55 +00:00
|
|
|
LDLIBS += -lsocket -lnsl
|
|
|
|
endif
|
2009-07-25 18:05:27 +00:00
|
|
|
|
2010-01-28 00:29:34 +00:00
|
|
|
ifeq ($(OPSYS),Haiku)
|
|
|
|
LDLIBS += -lnetwork
|
|
|
|
endif
|
|
|
|
|
2011-12-09 12:41:25 +00:00
|
|
|
ifeq ($(OPSYS),Linux)
|
|
|
|
NEED_LIBDL = YES
|
|
|
|
endif
|
|
|
|
|
2009-07-25 18:05:27 +00:00
|
|
|
CFLAGS += -I./src/
|
|
|
|
|
2010-01-28 00:29:34 +00:00
|
|
|
ifeq ($(OPSYS),Windows)
|
2009-02-19 16:14:09 +00:00
|
|
|
USE_BIGENDIAN := NO
|
|
|
|
LDLIBS += -lws2_32
|
|
|
|
UHUB_CONF_DIR ?= c:/uhub/
|
|
|
|
UHUB_PREFIX ?= c:/uhub/
|
|
|
|
CFLAGS += -mno-cygwin
|
|
|
|
LDFLAGS += -mno-cygwin
|
|
|
|
BIN_EXT ?= .exe
|
|
|
|
else
|
2009-03-17 00:38:55 +00:00
|
|
|
DESTDIR ?= /
|
|
|
|
UHUB_CONF_DIR ?= $(DESTDIR)/etc/uhub
|
2009-03-19 19:02:03 +00:00
|
|
|
UHUB_PREFIX ?= $(DESTDIR)/usr/local
|
2010-11-23 12:54:57 +00:00
|
|
|
UHUB_MOD_DIR ?= $(DESTDIR)/var/lib/uhub
|
2009-02-19 16:14:09 +00:00
|
|
|
CFLAGS += -I/usr/local/include
|
|
|
|
LDFLAGS += -L/usr/local/lib
|
|
|
|
BIN_EXT ?=
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SILENT),YES)
|
2010-02-11 00:02:19 +00:00
|
|
|
MSG_CC=@echo " CC:" $(notdir $<) &&
|
2009-02-19 16:14:09 +00:00
|
|
|
MSG_LD=@echo " LD:" $(notdir $@) &&
|
|
|
|
MSG_AR=@echo " AR:" $(notdir $@) &&
|
|
|
|
else
|
|
|
|
MSG_CC=
|
|
|
|
MSG_LD=
|
|
|
|
MSG_AR=
|
|
|
|
endif
|
|
|
|
|
2009-03-16 16:36:28 +00:00
|
|
|
ifeq ($(TERSE), YES)
|
|
|
|
MSG_CC=@
|
|
|
|
MSG_LD=@
|
|
|
|
MSG_AR=@
|
|
|
|
MSG_CLEAN=-n ""
|
|
|
|
else
|
|
|
|
MSG_CLEAN="Clean as a whistle"
|
|
|
|
endif
|
|
|
|
|
2009-02-19 16:14:09 +00:00
|
|
|
ifeq ($(RELEASE),YES)
|
2009-07-09 15:01:45 +00:00
|
|
|
CFLAGS += -O3 -DNDEBUG
|
2009-02-19 16:14:09 +00:00
|
|
|
else
|
2009-07-09 15:01:45 +00:00
|
|
|
CFLAGS += -ggdb -DDEBUG
|
2009-03-16 21:49:55 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(STACK_PROTECT),YES)
|
|
|
|
CFLAGS += -fstack-protector-all
|
2009-02-19 16:14:09 +00:00
|
|
|
endif
|
|
|
|
|
2009-03-16 21:49:55 +00:00
|
|
|
|
2009-02-19 16:14:09 +00:00
|
|
|
ifeq ($(PROFILING),YES)
|
|
|
|
CFLAGS += -pg
|
|
|
|
LDFLAGS += -pg
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(FUNCTRACE),YES)
|
|
|
|
CFLAGS += -finstrument-functions
|
|
|
|
CFLAGS += -DDEBUG_FUNCTION_TRACE
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(BITS), AUTO)
|
|
|
|
ifeq ($(BITS), 64)
|
|
|
|
CFLAGS += -m64
|
|
|
|
LDFLAGS += -m64
|
|
|
|
else
|
|
|
|
ifeq ($(BITS), 32)
|
|
|
|
CFLAGS += -m32
|
|
|
|
LDFLAGS += -m32
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(USE_BIGENDIAN),AUTO)
|
|
|
|
ifeq ($(shell perl -e 'print pack("L", 0x554E4958)'),UNIX)
|
|
|
|
CFLAGS += -DARCH_BIGENDIAN
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
ifeq ($(USE_BIGENDIAN),YES)
|
|
|
|
CFLAGS += -DARCH_BIGENDIAN
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(USE_SSL),YES)
|
|
|
|
CFLAGS += -DSSL_SUPPORT
|
2011-09-07 08:20:58 +00:00
|
|
|
LDLIBS += -lssl -lcrypto
|
2009-02-19 16:14:09 +00:00
|
|
|
endif
|
|
|
|
|
2011-12-09 12:41:25 +00:00
|
|
|
ifeq ($(NEED_LIBDL),YES)
|
|
|
|
LDLIBS += -ldl
|
|
|
|
endif
|
|
|
|
|
2010-02-11 08:16:30 +00:00
|
|
|
GIT_VERSION=$(shell git describe --tags 2>/dev/null || echo "")
|
2010-02-11 00:02:19 +00:00
|
|
|
GIT_REVISION=$(shell git show --abbrev-commit 2>/dev/null | head -n 1 | cut -f 2 -d " " || echo "")
|
|
|
|
OLD_REVISION=$(shell grep GIT_REVISION revision.h 2>/dev/null | cut -f 3 -d " " | tr -d "\"")
|
2009-06-23 14:11:30 +00:00
|
|
|
|
2009-02-19 16:14:09 +00:00
|
|
|
# Sources
|
|
|
|
libuhub_SOURCES := \
|
2009-07-25 18:05:27 +00:00
|
|
|
src/core/auth.c \
|
2012-05-01 18:15:43 +00:00
|
|
|
src/core/command_parser.c \
|
2009-07-25 18:05:27 +00:00
|
|
|
src/core/commands.c \
|
|
|
|
src/core/config.c \
|
|
|
|
src/core/eventqueue.c \
|
|
|
|
src/core/hub.c \
|
|
|
|
src/core/hubevent.c \
|
|
|
|
src/core/hubio.c \
|
|
|
|
src/core/inf.c \
|
2010-01-18 14:55:40 +00:00
|
|
|
src/core/netevent.c \
|
2009-10-07 15:37:31 +00:00
|
|
|
src/core/probe.c \
|
2010-01-18 14:55:40 +00:00
|
|
|
src/core/route.c \
|
|
|
|
src/core/user.c \
|
|
|
|
src/core/usermanager.c \
|
2011-12-09 09:29:50 +00:00
|
|
|
src/core/plugincallback.c \
|
2010-06-22 14:04:33 +00:00
|
|
|
src/core/plugininvoke.c \
|
2010-05-30 21:33:06 +00:00
|
|
|
src/core/pluginloader.c \
|
Add UCMD extension methods to plugin API.
The user command (UCMD) extension to the ADC protocol allows for sending
hub-specific commands to clients. These commands have a name (which
generally appears in a menu in the client) and a command string which
the client sends back to the hub when the command is selected. These
command strings can contain keyword substitutions for useful
information, such as the SID of another user that was selected in the
client.
This commit adds some support for sending user commands to the uhub
plugin API. It currently restricts the command string to containing main
chat messages (BMSG commands in ADC parlance).
A plugin_ucmd structure is added to store the details of a user command,
and four methods are added to the plugin_handle.hub structure:
* plugin->hub.ucmd_create(plugin, name, length) creates a new user
command.
* plugin->hub.ucmd_add_chat(plugin, ucmd, message, me) adds a main chat
message to the list of commands to be run when the user command is
selected. The me flag allows IRC /me style messages.
* plugin->hub.ucmd_send(plugin, user, ucmd) sends the command to a user.
* plugin->hub.ucmd_free(plugin, ucmd) frees the memory taken by a user
command.
The structure has a number of flags (categories, remove, separator,
constrained) which correspond to the flags in the UCMD specification.
The categories flag must be set prior to sending to one (or more, via
a logical OR) of the ucmd_category_* enumeration values defined in
plugin_api/types.h.
The PLUGIN_API_VERSION has been increased to 2 to mark the change.
2012-08-01 14:26:54 +00:00
|
|
|
src/core/pluginucmd.c \
|
2010-01-21 00:12:57 +00:00
|
|
|
src/network/backend.c \
|
2010-01-19 13:53:47 +00:00
|
|
|
src/network/connection.c \
|
2010-01-18 14:55:40 +00:00
|
|
|
src/network/epoll.c \
|
2010-01-26 22:30:32 +00:00
|
|
|
src/network/kqueue.c \
|
2010-01-20 16:26:23 +00:00
|
|
|
src/network/select.c \
|
2010-01-26 21:54:14 +00:00
|
|
|
src/network/timeout.c \
|
2010-07-08 12:24:40 +00:00
|
|
|
src/network/timer.c
|
|
|
|
|
|
|
|
|
|
|
|
libadc_common_SOURCES := \
|
|
|
|
src/adc/message.c \
|
|
|
|
src/adc/sid.c
|
|
|
|
|
|
|
|
libutils_SOURCES := \
|
2011-12-21 12:53:12 +00:00
|
|
|
src/util/cbuffer.c \
|
2010-07-09 11:04:20 +00:00
|
|
|
src/util/config_token.c \
|
2010-07-12 15:00:42 +00:00
|
|
|
src/util/credentials.c \
|
2010-08-11 18:02:06 +00:00
|
|
|
src/util/floodctl.c \
|
2010-01-19 13:53:47 +00:00
|
|
|
src/util/ipcalc.c \
|
2009-07-25 18:05:27 +00:00
|
|
|
src/util/list.c \
|
|
|
|
src/util/log.c \
|
|
|
|
src/util/memory.c \
|
|
|
|
src/util/misc.c \
|
2011-12-21 13:31:29 +00:00
|
|
|
src/network/network.c \
|
2009-07-25 18:05:27 +00:00
|
|
|
src/util/rbtree.c \
|
2010-01-18 14:55:40 +00:00
|
|
|
src/util/tiger.c
|
2009-07-25 18:05:27 +00:00
|
|
|
|
2009-08-28 14:18:18 +00:00
|
|
|
libadc_client_SOURCES := \
|
|
|
|
src/tools/adcclient.c
|
|
|
|
|
|
|
|
uhub_SOURCES := src/core/main.c
|
2009-08-28 12:29:19 +00:00
|
|
|
|
2011-12-20 15:20:54 +00:00
|
|
|
uhub-passwd_SOURCES := src/tools/uhub-passwd.c
|
|
|
|
uhub-passwd_LIBS := -lsqlite3
|
|
|
|
|
2009-08-02 19:07:16 +00:00
|
|
|
adcrush_SOURCES := src/tools/adcrush.c
|
2009-02-19 16:14:09 +00:00
|
|
|
|
2009-08-28 12:29:19 +00:00
|
|
|
admin_SOURCES := src/tools/admin.c
|
2009-05-26 17:46:51 +00:00
|
|
|
|
2009-02-19 16:14:09 +00:00
|
|
|
autotest_SOURCES := \
|
2011-12-18 23:34:20 +00:00
|
|
|
autotest/test_commands.tcc \
|
2010-07-29 09:21:43 +00:00
|
|
|
autotest/test_credentials.tcc \
|
2010-02-18 15:02:13 +00:00
|
|
|
autotest/test_eventqueue.tcc \
|
|
|
|
autotest/test_hub.tcc \
|
|
|
|
autotest/test_inf.tcc \
|
|
|
|
autotest/test_ipfilter.tcc \
|
2009-02-19 16:14:09 +00:00
|
|
|
autotest/test_list.tcc \
|
|
|
|
autotest/test_memory.tcc \
|
2010-02-18 15:02:13 +00:00
|
|
|
autotest/test_message.tcc \
|
2009-02-19 16:14:09 +00:00
|
|
|
autotest/test_misc.tcc \
|
2010-02-18 15:02:13 +00:00
|
|
|
autotest/test_sid.tcc \
|
2009-02-19 16:14:09 +00:00
|
|
|
autotest/test_tiger.tcc \
|
2010-02-25 16:57:50 +00:00
|
|
|
autotest/test_timer.tcc \
|
2010-07-09 11:04:20 +00:00
|
|
|
autotest/test_tokenizer.tcc \
|
2010-02-18 15:02:13 +00:00
|
|
|
autotest/test_usermanager.tcc
|
2009-02-19 16:14:09 +00:00
|
|
|
|
|
|
|
autotest_OBJECTS = autotest.o
|
|
|
|
|
2010-07-08 12:24:40 +00:00
|
|
|
# Plugin targets:
|
2010-06-06 14:15:15 +00:00
|
|
|
plugin_example_SOURCES := src/plugins/mod_example.c
|
2010-07-08 12:24:40 +00:00
|
|
|
plugin_example_TARGET := mod_example.so
|
2010-06-06 14:15:15 +00:00
|
|
|
|
2011-12-21 13:31:29 +00:00
|
|
|
plugin_welcome_SOURCES := src/plugins/mod_welcome.c
|
|
|
|
plugin_welcome_TARGET := mod_welcome.so
|
|
|
|
|
2010-06-22 14:04:33 +00:00
|
|
|
plugin_logging_SOURCES := src/plugins/mod_logging.c
|
2010-07-08 12:24:40 +00:00
|
|
|
plugin_logging_TARGET := mod_logging.so
|
|
|
|
|
|
|
|
plugin_auth_SOURCES := src/plugins/mod_auth_simple.c
|
|
|
|
plugin_auth_TARGET := mod_auth_simple.so
|
2010-06-22 14:04:33 +00:00
|
|
|
|
2010-07-29 06:46:52 +00:00
|
|
|
plugin_auth_sqlite_SOURCES := src/plugins/mod_auth_sqlite.c
|
|
|
|
plugin_auth_sqlite_TARGET := mod_auth_sqlite.so
|
|
|
|
plugin_auth_sqlite_LIBS := -lsqlite3
|
|
|
|
|
2012-05-09 21:27:06 +00:00
|
|
|
plugin_chat_history_SOURCES := src/plugins/mod_chat_history.c
|
|
|
|
plugin_chat_history_TARGET := mod_chat_history.so
|
2010-06-06 14:15:15 +00:00
|
|
|
|
2012-05-09 21:27:06 +00:00
|
|
|
plugin_chat_only_SOURCES := src/plugins/mod_chat_only.c
|
|
|
|
plugin_chat_only_TARGET := mod_chat_only.so
|
2012-01-09 18:54:03 +00:00
|
|
|
|
2012-04-18 22:21:49 +00:00
|
|
|
plugin_topic_SOURCES := src/plugins/mod_topic.c
|
2012-05-09 21:27:06 +00:00
|
|
|
plugin_topic_TARGET := mod_topic.so
|
2012-04-18 22:21:49 +00:00
|
|
|
|
2012-08-08 07:19:27 +00:00
|
|
|
plugin_ucmd_SOURCES := src/plugins/mod_ucmd.c
|
|
|
|
plugin_ucmd_TARGET := mod_ucmd.so
|
|
|
|
|
2009-02-19 16:14:09 +00:00
|
|
|
# Source to objects
|
2009-08-28 14:18:18 +00:00
|
|
|
libuhub_OBJECTS := $(libuhub_SOURCES:.c=.o)
|
2010-07-08 12:24:40 +00:00
|
|
|
libutils_OBJECTS := $(libutils_SOURCES:.c=.o)
|
2009-08-28 14:18:18 +00:00
|
|
|
libadc_client_OBJECTS := $(libadc_client_SOURCES:.c=.o)
|
|
|
|
libadc_common_OBJECTS := $(libadc_common_SOURCES:.c=.o)
|
|
|
|
|
|
|
|
uhub_OBJECTS := $(uhub_SOURCES:.c=.o)
|
2011-12-20 15:20:54 +00:00
|
|
|
uhub-passwd_OBJECTS := $(uhub-passwd_SOURCES:.c=.o)
|
2009-08-28 14:18:18 +00:00
|
|
|
adcrush_OBJECTS := $(adcrush_SOURCES:.c=.o)
|
|
|
|
admin_OBJECTS := $(admin_SOURCES:.c=.o)
|
2009-02-19 16:14:09 +00:00
|
|
|
|
2012-05-09 21:27:06 +00:00
|
|
|
all_plugins := \
|
|
|
|
$(plugin_example_TARGET) \
|
|
|
|
$(plugin_logging_TARGET) \
|
|
|
|
$(plugin_auth_TARGET) \
|
|
|
|
$(plugin_auth_sqlite_TARGET) \
|
|
|
|
$(plugin_welcome_TARGET) \
|
|
|
|
$(plugin_chat_history_TARGET) \
|
|
|
|
$(plugin_chat_only_TARGET) \
|
2012-08-08 07:19:27 +00:00
|
|
|
$(plugin_topic_TARGET) \
|
|
|
|
$(plugin_ucmd_TARGET)
|
2012-05-09 21:27:06 +00:00
|
|
|
|
|
|
|
all_OBJECTS := \
|
|
|
|
$(libuhub_OBJECTS) \
|
|
|
|
$(uhub_OBJECTS) \
|
|
|
|
$(libutils_OBJECTS) \
|
|
|
|
$(adcrush_OBJECTS) \
|
|
|
|
$(autotest_OBJECTS) \
|
|
|
|
$(admin_OBJECTS) \
|
|
|
|
$(libadc_common_OBJECTS) \
|
|
|
|
$(libadc_client_OBJECTS)
|
|
|
|
|
|
|
|
all_OBJECTS += $(all_plugins)
|
2009-02-19 16:14:09 +00:00
|
|
|
|
|
|
|
uhub_BINARY=uhub$(BIN_EXT)
|
2011-12-20 15:20:54 +00:00
|
|
|
uhub-passwd_BINARY=uhub-passwd$(BIN_EXT)
|
2009-02-19 16:14:09 +00:00
|
|
|
adcrush_BINARY=adcrush$(BIN_EXT)
|
2009-05-26 17:46:51 +00:00
|
|
|
admin_BINARY=uhub-admin$(BIN_EXT)
|
2009-02-19 16:14:09 +00:00
|
|
|
autotest_BINARY=autotest/test$(BIN_EXT)
|
|
|
|
|
2010-06-06 14:15:15 +00:00
|
|
|
|
2010-07-08 12:24:40 +00:00
|
|
|
.PHONY: revision.h.tmp all plugins
|
2010-06-06 14:15:15 +00:00
|
|
|
|
2010-02-11 00:02:19 +00:00
|
|
|
%.o: %.c version.h revision.h
|
2010-07-08 12:24:40 +00:00
|
|
|
$(MSG_CC) $(CC) -fPIC -c $(CFLAGS) -o $@ $<
|
2009-02-19 16:14:09 +00:00
|
|
|
|
2011-12-21 13:31:29 +00:00
|
|
|
|
|
|
|
#%.so: %.c
|
|
|
|
# $(MSG_CC) $(CC) -shared -fPIC -o $@ $^ $(CFLAGS)
|
|
|
|
|
|
|
|
|
2011-12-20 15:20:54 +00:00
|
|
|
all: $(uhub_BINARY) $(uhub-passwd_BINARY) plugins
|
2009-05-26 17:46:51 +00:00
|
|
|
|
2010-07-08 12:24:40 +00:00
|
|
|
plugins: $(uhub_BINARY) $(all_plugins)
|
|
|
|
|
|
|
|
$(plugin_auth_TARGET): $(plugin_auth_SOURCES) $(libutils_OBJECTS)
|
|
|
|
$(MSG_CC) $(CC) -shared -fPIC -o $@ $^ $(CFLAGS)
|
|
|
|
|
2010-07-29 06:46:52 +00:00
|
|
|
$(plugin_auth_sqlite_TARGET): $(plugin_auth_sqlite_SOURCES) $(libutils_OBJECTS)
|
2011-12-02 12:56:41 +00:00
|
|
|
$(MSG_CC) $(CC) -shared -fPIC -o $@ $^ $(CFLAGS) $(LDFLAGS) $(plugin_auth_sqlite_LIBS)
|
2010-07-29 06:46:52 +00:00
|
|
|
|
2011-12-09 09:29:50 +00:00
|
|
|
$(plugin_example_TARGET): $(plugin_example_SOURCES) $(libutils_OBJECTS)
|
2010-07-08 12:24:40 +00:00
|
|
|
$(MSG_CC) $(CC) -shared -fPIC -o $@ $^ $(CFLAGS)
|
|
|
|
|
2010-08-04 15:03:37 +00:00
|
|
|
$(plugin_logging_TARGET): $(plugin_logging_SOURCES) $(libutils_OBJECTS) $(libadc_common_OBJECTS) src/network/network.o
|
2010-07-08 12:24:40 +00:00
|
|
|
$(MSG_CC) $(CC) -shared -fPIC -o $@ $^ $(CFLAGS)
|
|
|
|
|
2012-05-09 21:27:06 +00:00
|
|
|
$(plugin_chat_history_TARGET): $(plugin_chat_history_SOURCES) $(libutils_OBJECTS)
|
2011-12-09 09:29:50 +00:00
|
|
|
$(MSG_CC) $(CC) -shared -fPIC -o $@ $^ $(CFLAGS)
|
|
|
|
|
2012-05-09 21:27:06 +00:00
|
|
|
$(plugin_chat_only_TARGET): $(plugin_chat_only_SOURCES) $(libutils_OBJECTS)
|
2012-01-09 18:54:03 +00:00
|
|
|
$(MSG_CC) $(CC) -shared -fPIC -o $@ $^ $(CFLAGS)
|
|
|
|
|
2011-12-21 13:31:29 +00:00
|
|
|
$(plugin_welcome_TARGET): $(plugin_welcome_SOURCES) $(libutils_OBJECTS)
|
|
|
|
$(MSG_CC) $(CC) -shared -fPIC -o $@ $^ $(CFLAGS)
|
|
|
|
|
2012-04-18 22:21:49 +00:00
|
|
|
$(plugin_topic_TARGET): $(plugin_topic_SOURCES) $(libutils_OBJECTS)
|
|
|
|
$(MSG_CC) $(CC) -shared -fPIC -o $@ $^ $(CFLAGS)
|
|
|
|
|
2012-08-08 07:19:27 +00:00
|
|
|
$(plugin_ucmd_TARGET): $(plugin_ucmd_SOURCES) $(libutils_OBJECTS)
|
|
|
|
$(MSG_CC) $(CC) -shared -fPIC -o $@ $^ $(CFLAGS)
|
2012-04-18 22:21:49 +00:00
|
|
|
|
2010-07-08 12:24:40 +00:00
|
|
|
$(adcrush_BINARY): $(adcrush_OBJECTS) $(libuhub_OBJECTS) $(libutils_OBJECTS) $(libadc_common_OBJECTS) $(libadc_client_OBJECTS)
|
2009-08-28 14:04:45 +00:00
|
|
|
$(MSG_LD) $(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS)
|
2009-02-19 16:14:09 +00:00
|
|
|
|
2010-07-08 12:24:40 +00:00
|
|
|
$(admin_BINARY): $(admin_OBJECTS) $(libuhub_OBJECTS) $(libutils_OBJECTS) $(libadc_common_OBJECTS) $(libadc_client_OBJECTS)
|
2009-08-28 14:04:45 +00:00
|
|
|
$(MSG_LD) $(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS)
|
2009-08-28 12:29:19 +00:00
|
|
|
|
2010-07-08 12:24:40 +00:00
|
|
|
$(uhub_BINARY): $(uhub_OBJECTS) $(libuhub_OBJECTS) $(libutils_OBJECTS) $(libadc_common_OBJECTS)
|
2009-08-28 14:04:45 +00:00
|
|
|
$(MSG_LD) $(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS)
|
2009-02-19 16:14:09 +00:00
|
|
|
|
2012-04-18 21:03:05 +00:00
|
|
|
$(uhub-passwd_BINARY): $(uhub-passwd_OBJECTS) src/util/misc.o src/util/list.o src/util/memory.o src/util/log.o
|
2011-12-20 15:20:54 +00:00
|
|
|
$(MSG_LD) $(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(uhub-passwd_LIBS)
|
|
|
|
|
|
|
|
|
2009-03-16 17:27:29 +00:00
|
|
|
autotest.c: $(autotest_SOURCES)
|
|
|
|
$(shell exotic --standalone $(autotest_SOURCES) > $@)
|
|
|
|
|
2010-02-11 00:02:19 +00:00
|
|
|
revision.h.tmp:
|
|
|
|
@rm -f $@
|
|
|
|
@echo "/* AUTOGENERATED FILE - DO NOT EDIT */" > $@
|
|
|
|
@if [ -n '$(GIT_VERSION)' ]; then echo \#define GIT_VERSION \"$(GIT_VERSION)\" >> $@; fi
|
|
|
|
@if [ -n '$(GIT_REVISION)' ]; then echo \#define GIT_REVISION \"$(GIT_REVISION)\" >> $@; fi
|
|
|
|
|
|
|
|
version.h: revision.h
|
|
|
|
|
|
|
|
revision.h: revision.h.tmp
|
2010-02-25 15:38:05 +00:00
|
|
|
@if [ '$(GIT_REVISION)' != '$(OLD_REVISION)' ]; then cp $@.tmp $@; fi
|
|
|
|
@if [ ! -f $@ ]; then cp $@.tmp $@; fi
|
2010-02-11 00:02:19 +00:00
|
|
|
|
2009-02-19 16:14:09 +00:00
|
|
|
$(autotest_OBJECTS): autotest.c
|
2009-06-25 15:35:59 +00:00
|
|
|
$(MSG_CC) $(CC) -c $(CFLAGS) -Isrc -o $@ $<
|
2009-02-19 16:14:09 +00:00
|
|
|
|
2010-07-08 12:24:40 +00:00
|
|
|
$(autotest_BINARY): $(autotest_OBJECTS) $(libuhub_OBJECTS) $(libutils_OBJECTS) $(libadc_common_OBJECTS) $(libadc_client_OBJECTS)
|
2009-06-25 15:35:59 +00:00
|
|
|
$(MSG_LD) $(CC) -o $@ $^ $(LDFLAGS) $(LDLIBS)
|
2009-02-19 16:14:09 +00:00
|
|
|
|
|
|
|
autotest: $(autotest_BINARY)
|
|
|
|
@./$(autotest_BINARY) -s -f
|
|
|
|
|
|
|
|
ifeq ($(WINDOWS),YES)
|
|
|
|
install:
|
|
|
|
@echo "Cannot install automatically on windows."
|
|
|
|
else
|
2012-05-03 08:13:21 +00:00
|
|
|
install: all
|
2009-02-19 16:14:09 +00:00
|
|
|
@echo Copying $(uhub_BINARY) to $(UHUB_PREFIX)/bin/
|
|
|
|
@cp $(uhub_BINARY) $(UHUB_PREFIX)/bin/
|
2011-12-22 00:14:34 +00:00
|
|
|
@cp $(uhub-passwd_BINARY) $(UHUB_PREFIX)/bin/
|
2009-02-19 16:14:09 +00:00
|
|
|
@if [ ! -d $(UHUB_CONF_DIR) ]; then echo Creating $(UHUB_CONF_DIR); mkdir -p $(UHUB_CONF_DIR); fi
|
|
|
|
@if [ ! -f $(UHUB_CONF_DIR)/uhub.conf ]; then cp doc/uhub.conf $(UHUB_CONF_DIR); fi
|
2012-05-09 21:27:06 +00:00
|
|
|
@if [ ! -f $(UHUB_CONF_DIR)/rules.txt ]; then cp doc/rules.txt $(UHUB_CONF_DIR); fi
|
|
|
|
@if [ ! -f $(UHUB_CONF_DIR)/plugins.conf ]; then cp doc/plugins.conf $(UHUB_CONF_DIR); fi
|
2012-08-08 07:19:27 +00:00
|
|
|
@if [ ! -f $(UHUB_CONF_DIR)/ucmd.conf ]; then cp doc/ucmd.conf $(UHUB_CONF_DIR); fi
|
2010-11-23 12:54:57 +00:00
|
|
|
@if [ ! -d $(UHUB_MOD_DIR) ]; then echo Creating $(UHUB_MOD_DIR); mkdir -p $(UHUB_MOD_DIR); fi
|
|
|
|
@cp -f mod_*.so $(UHUB_MOD_DIR)
|
2009-03-17 00:38:55 +00:00
|
|
|
@touch $(UHUB_CONF_DIR)/motd.txt
|
2009-02-19 16:14:09 +00:00
|
|
|
@echo done.
|
|
|
|
endif
|
|
|
|
|
|
|
|
dist-clean:
|
2009-08-28 14:04:45 +00:00
|
|
|
@rm -rf $(all_OBJECTS) *~ core
|
2009-02-19 16:14:09 +00:00
|
|
|
|
|
|
|
clean:
|
2012-04-16 10:45:57 +00:00
|
|
|
@rm -rf $(libuhub_OBJECTS) *~ core $(uhub_BINARY) $(uhub-passwd_BINARY) $(admin_BINARY) $(autotest_BINARY) $(adcrush_BINARY) $(all_OBJECTS) $(all_plugins) autotest.c revision.h revision.h.tmp && \
|
2009-03-16 16:36:28 +00:00
|
|
|
echo $(MSG_CLEAN)
|