From 6b75d281acad052564f5474ba47dd2e6ae0fa3eb Mon Sep 17 00:00:00 2001 From: eutarass Date: Mon, 11 Oct 2010 20:32:25 +0000 Subject: TCF Agent: fixed few build errors that happen when the code is built with OPSYS=MinGW --- Makefile | 17 +++++++++-------- Makefile.inc | 5 +++++ server/Makefile | 6 +++--- system/MinGW/regset.h | 22 ++++++++++++++++++++++ 4 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 system/MinGW/regset.h diff --git a/Makefile b/Makefile index 4a99e94d..00a5df45 100644 --- a/Makefile +++ b/Makefile @@ -38,15 +38,13 @@ $(BINDIR)/tcflog$(EXTEXE): $(BINDIR)/main/main_log$(EXTOBJ) $(BINDIR)/libtcf$(EX $(CC) $(CFLAGS) -o $@ $(BINDIR)/main/main_log$(EXTOBJ) $(BINDIR)/libtcf$(EXTLIB) $(LIBS) $(BINDIR)/%$(EXTOBJ): %.c $(HFILES) Makefile Makefile.inc -ifeq ($(OPSYS),MinGW) - if not exist $(subst /,\,$(dir $@)) mkdir $(subst /,\,$(dir $@)) -else - mkdir -p $(dir $@) -endif + @$(call MKDIR,$(dir $@)) $(CC) $(CFLAGS) -c -o $@ $< -clean: - rm -rf $(BINDIR) RPM *.tar *.tar.bz2 *.rpm +clean:: + $(call RMDIR,$(BINDIR)) + +ifeq ($(OPSYS),GNU/Linux) install: all install -d -m 755 $(INSTALLROOT)$(SBIN) @@ -74,7 +72,6 @@ tcf-agent-$(VERSION).tar.bz2: $(HFILES) $(CFILES) Makefile Makefile.inc main/tcf tar: tcf-agent-$(VERSION).tar.bz2 -ifeq ($(OPSYS),GNU/Linux) rpm: all tar rm -rf RPM mkdir RPM RPM/BUILD RPM/RPMS RPM/RPMS/`uname -i` RPM/RPMS/noarch RPM/SOURCES RPM/SPECS RPM/SRPMS RPM/tmp @@ -84,4 +81,8 @@ rpm: all tar mv RPM/RPMS/`uname -i`/*.rpm . mv RPM/SRPMS/*.rpm . rm -rf RPM ~/.rpmmacros + +clean:: + rm -rf RPM *.tar *.tar.bz2 *.rpm + endif diff --git a/Makefile.inc b/Makefile.inc index 25309c54..63c9b68e 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -11,6 +11,9 @@ INCDIRS = . system/$(OPSYS) machine/$(MACHINE) SRCDIRS = $(INCDIRS) system framework services main BINDIR = obj/$(OPSYS)/$(MACHINE)/$(CONF) +MKDIR = mkdir -p $(1) +RMDIR = rm -rf $(1) + ifeq ($(CONF),Debug) OPTS += -g else @@ -39,6 +42,8 @@ ifeq ($(OPSYS),MinGW) EXTOBJ = .obj EXTEXE = .exe LIBS = -lws2_32 -liphlpapi + MKDIR = if not exist $(subst /,\,$(1)) mkdir $(subst /,\,$(1)) + RMDIR = if exist $(subst /,\,$(1)) rmdir /s /q $(subst /,\,$(1)) endif ifeq ($(OPSYS),Darwin) diff --git a/server/Makefile b/server/Makefile index 5c5eccb3..aaf59c8f 100644 --- a/server/Makefile +++ b/server/Makefile @@ -19,12 +19,12 @@ $(BINDIR)/server$(EXTEXE): $(BINDIR)/main/main$(EXTOBJ) $(BINDIR)/libtcf$(EXTLIB $(CC) $(CFLAGS) -o $@ $(BINDIR)/main/main$(EXTOBJ) $(BINDIR)/libtcf$(EXTLIB) $(LIBS) $(BINDIR)/%$(EXTOBJ): %.c $(HFILES) Makefile - @mkdir -p $(dir $@) + @$(call MKDIR,$(dir $@)) $(CC) $(CFLAGS) -c -o $@ $< $(BINDIR)/%$(EXTOBJ): $(TCF_AGENT_DIR)/%.c $(HFILES) Makefile - @mkdir -p $(dir $@) + @$(call MKDIR,$(dir $@)) $(CC) $(CFLAGS) -c -o $@ $< clean: - rm -rf $(BINDIR) + $(call RMDIR,$(BINDIR)) diff --git a/system/MinGW/regset.h b/system/MinGW/regset.h new file mode 100644 index 00000000..07d0f831 --- /dev/null +++ b/system/MinGW/regset.h @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2009, 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 + *******************************************************************************/ + +/* + * This header file provides definition of REG_SET - a structure that can + * hold values of target CPU registers. + */ + +#if defined(WIN32) + typedef CONTEXT REG_SET; +#endif -- cgit v1.2.3