Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2009-11-02 14:32:37 -0500
committereutarass2009-11-02 14:32:37 -0500
commit2bdbe1e0826f84d5219619f4a3ad5ea16563598c (patch)
treecc3ec47bc67920b450159cbe34cafd59bd02b278 /examples
parent736aaac2d3ffc9995677831eda66f9aadf3bcd2c (diff)
downloadorg.eclipse.tcf-2bdbe1e0826f84d5219619f4a3ad5ea16563598c.tar.gz
org.eclipse.tcf-2bdbe1e0826f84d5219619f4a3ad5ea16563598c.tar.xz
org.eclipse.tcf-2bdbe1e0826f84d5219619f4a3ad5ea16563598c.zip
Bug 225082 - [tcf][releng] Improve TCF Agent build directory structure
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.tm.tcf.examples.daytime.agent/Makefile55
-rw-r--r--examples/org.eclipse.tm.tcf.examples.daytime.agent/config.h1
-rw-r--r--examples/org.eclipse.tm.tcf.examples.daytime.agent/daytime.c1
3 files changed, 20 insertions, 37 deletions
diff --git a/examples/org.eclipse.tm.tcf.examples.daytime.agent/Makefile b/examples/org.eclipse.tm.tcf.examples.daytime.agent/Makefile
index 25f2c2a86..62a3063e2 100644
--- a/examples/org.eclipse.tm.tcf.examples.daytime.agent/Makefile
+++ b/examples/org.eclipse.tm.tcf.examples.daytime.agent/Makefile
@@ -1,49 +1,30 @@
-CONF=Debug
TCF_AGENT_DIR=../../agent
-CC=gcc
-ifeq ($(CONF),Debug)
-CFLAGS=-g
-else
-CFLAGS=-O
-endif
-CFLAGS:=$(CFLAGS) -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -Wmissing-prototypes -I. -I$(TCF_AGENT_DIR) -I-
-
-OPSYS=$(shell uname -o)
-MACHINE=$(shell uname -m)
-ifeq ($(OPSYS),Cygwin)
-LIBS=-lws2_32 -liphlpapi
-else
-ifeq ($(OPSYS),Msys)
-CFLAGS:=-mwin32 $(CFLAGS)
-LIBS=-lws2_32 -liphlpapi
-else
-LIBS=-lpthread -lrt
-endif
-endif
-
-BINDIR=$(OPSYS)/$(MACHINE)/$(CONF)
-
-CFILES=$(basename $(wildcard *.c)) $(basename $(notdir $(wildcard $(TCF_AGENT_DIR)/*.c)))
-OFILES=$(addprefix $(BINDIR)/,$(filter-out main%.o, $(addsuffix .o, $(CFILES))))
-HFILES=$(wildcard *.h) $(wildcard $(TCF_AGENT_DIR)/*.h) Makefile
-
-EXECS=$(BINDIR)/agent
+
+include $(TCF_AGENT_DIR)/Makefile.inc
+
+CFLAGS := $(foreach dir,$(SRCDIRS),-I$(dir)) $(CFLAGS)
+HFILES := $(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.h)) $(HFILES)
+CFILES := $(sort $(foreach dir,$(SRCDIRS),$(wildcard $(dir)/*.c)) $(CFILES))
+
+EXECS = $(BINDIR)/agent$(EXTEXE)
all: $(EXECS)
-$(BINDIR)/libtcf.a : $(OFILES)
- ar -rc $@ $(OFILES)
+$(BINDIR)/libtcf$(EXTLIB) : $(OFILES)
+ $(AR) -rc $@ $^
+ $(RANLIB)
-$(BINDIR)/agent: $(BINDIR)/main.o $(BINDIR)/libtcf.a
- $(CC) $(CFLAGS) -o $@ $(BINDIR)/main.o $(BINDIR)/libtcf.a $(LIBS)
+$(BINDIR)/agent$(EXTEXE): $(BINDIR)/main/main$(EXTOBJ) $(BINDIR)/libtcf$(EXTLIB)
+ $(CC) $(CFLAGS) -o $@ $(BINDIR)/main/main$(EXTOBJ) $(BINDIR)/libtcf$(EXTLIB) $(LIBS)
-$(BINDIR)/%.o: %.c $(HFILES) $(HFILES)
- @mkdir -p $(BINDIR)
+$(BINDIR)/%$(EXTOBJ): %.c $(HFILES) Makefile
+ @mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c -o $@ $<
-$(BINDIR)/%.o: $(TCF_AGENT_DIR)/%.c $(HFILES)
- @mkdir -p $(BINDIR)
+$(BINDIR)/%$(EXTOBJ): $(TCF_AGENT_DIR)/%.c $(HFILES) Makefile
+ @mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -rf $(BINDIR)
+
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 2a42a1250..57e861870 100644
--- a/examples/org.eclipse.tm.tcf.examples.daytime.agent/config.h
+++ b/examples/org.eclipse.tm.tcf.examples.daytime.agent/config.h
@@ -46,6 +46,7 @@
* which is executed during agent startup.
*/
+#include "discovery.h"
#include "filesystem.h"
#include "sysmon.h"
#include "diagnostics.h"
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 4332b2edb..247568bf1 100644
--- a/examples/org.eclipse.tm.tcf.examples.daytime.agent/daytime.c
+++ b/examples/org.eclipse.tm.tcf.examples.daytime.agent/daytime.c
@@ -21,6 +21,7 @@
#include "daytime.h"
#include "json.h"
#include "errors.h"
+#include "exceptions.h"
static const char * DAYTIME = "Daytime";

Back to the top