diff options
Diffstat (limited to 'examples')
4 files changed, 30 insertions, 29 deletions
diff --git a/examples/org.eclipse.tm.tcf.examples.daytime.agent/Makefile b/examples/org.eclipse.tm.tcf.examples.daytime.agent/Makefile index 62a3063e2..5f544787f 100644 --- a/examples/org.eclipse.tm.tcf.examples.daytime.agent/Makefile +++ b/examples/org.eclipse.tm.tcf.examples.daytime.agent/Makefile @@ -2,7 +2,8 @@ TCF_AGENT_DIR=../../agent include $(TCF_AGENT_DIR)/Makefile.inc -CFLAGS := $(foreach dir,$(SRCDIRS),-I$(dir)) $(CFLAGS) +override CFLAGS := $(foreach dir,$(SRCDIRS),-I$(dir)) $(CFLAGS) + HFILES := $(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.h)) $(HFILES) CFILES := $(sort $(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.c)) $(CFILES)) diff --git a/examples/org.eclipse.tm.tcf.examples.daytime.agent/config.h b/examples/org.eclipse.tm.tcf.examples.daytime.agent/config.h index 7283525a2..b97f7356e 100644 --- a/examples/org.eclipse.tm.tcf.examples.daytime.agent/config.h +++ b/examples/org.eclipse.tm.tcf.examples.daytime.agent/config.h @@ -33,36 +33,11 @@ # define TARGET_UNIX 1 #endif -#define SERVICE_FileSystem 1 -#define SERVICE_SysMonitor TARGET_UNIX +#define SERVICE_FileSystem 1 +#define SERVICE_SysMonitor TARGET_UNIX #define ENABLE_Trace 1 #define ENABLE_Discovery 1 -#ifdef CONFIG_MAIN -/* - * This part of config.h contains services initialization code, - * which is executed during agent startup. - */ - -#include "discovery.h" -#include "filesystem.h" -#include "sysmon.h" -#include "diagnostics.h" -#include "daytime.h" - -static void ini_services(Protocol * proto, TCFBroadcastGroup * bcg) { -#if SERVICE_FileSystem - ini_file_system_service(proto); -#endif -#if SERVICE_SysMonitor - ini_sys_mon_service(proto); -#endif - ini_diagnostics_service(proto); - ini_daytime_service(proto); -} - -#endif /* CONFIG_MAIN */ - #endif /* D_config */ diff --git a/examples/org.eclipse.tm.tcf.examples.daytime.agent/daytime.c b/examples/org.eclipse.tm.tcf.examples.daytime.agent/daytime.c index 247568bf1..55571e2eb 100644 --- a/examples/org.eclipse.tm.tcf.examples.daytime.agent/daytime.c +++ b/examples/org.eclipse.tm.tcf.examples.daytime.agent/daytime.c @@ -16,7 +16,7 @@ * Sample TCF service implementation. */ -#include "mdep.h" +#include "config.h" #include <time.h> #include "daytime.h" #include "json.h" diff --git a/examples/org.eclipse.tm.tcf.examples.daytime.agent/services-ext.h b/examples/org.eclipse.tm.tcf.examples.daytime.agent/services-ext.h new file mode 100644 index 000000000..74bd0ff07 --- /dev/null +++ b/examples/org.eclipse.tm.tcf.examples.daytime.agent/services-ext.h @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2007, 2010 Wind River Systems, Inc. and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and Eclipse Distribution License v1.0 which accompany this distribution. + * The Eclipse Public License is available at + * http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Wind River Systems - initial API and implementation + *******************************************************************************/ + +/* + * Services initialization code extension point. + * If the agent is built with additional user-defined services, + * a customized version of services-ext.h file can be added to compiler headers search paths. + */ + +#include "daytime.h" + +static void ini_ext_services(Protocol * proto, TCFBroadcastGroup * bcg) { + ini_daytime_service(proto); +} |