]> rtime.felk.cvut.cz Git - omk/sssa.git/commitdiff
VxWorks rules are working now.
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 26 Oct 2006 04:36:00 +0000 (04:36 +0000)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 26 Oct 2006 04:36:00 +0000 (04:36 +0000)
darcs-hash:20061026043633-f2ef6-075e8c783f7d2fb5539500506daa210c2178a137.gz

snippets/vxworks
snippets/vxworks-setup
tests/vxworks/fibo-rtp/Makefile [moved from tests/vxworks/rtp/Makefile with 100% similarity]
tests/vxworks/fibo-rtp/Makefile.omk [moved from tests/vxworks/rtp/Makefile.omk with 52% similarity]
tests/vxworks/fibo-rtp/fibo2.c [moved from tests/vxworks/rtp/fibo2.c with 96% similarity]
tests/vxworks/fibo-rtp/fiboprint.c [new file with mode: 0644]
tests/vxworks/fibo-rtplib/Makefile [moved from tests/vxworks/rtplib/Makefile with 100% similarity]
tests/vxworks/fibo-rtplib/Makefile.omk [moved from tests/vxworks/rtplib/Makefile.omk with 100% similarity]
tests/vxworks/fibo-rtplib/fibofnc.c [moved from tests/vxworks/rtplib/fibofnc.c with 100% similarity]
tests/vxworks/fibo-rtplib/fibolib.h [moved from tests/vxworks/rtplib/fibolib.h with 100% similarity]
tests/vxworks/fibo-rtplib/fiboseries.c [moved from tests/vxworks/rtplib/fiboseries.c with 100% similarity]

index 49469ec4d84c024bdfdd114df74ab56abf78888f..48bfa2d9f84fc0308865f280f982c9e47ee1c7a7 100644 (file)
@@ -25,9 +25,7 @@ OMK_SERIALIZE_INCLUDED = y
 endif
 
 
-BUILD_ROOT=$(USER_OBJS_DIR)
-export BUILD_ROOT
-
+# Export some variables to VxWorks makefiles
 CPPFLAGS  += -I $(USER_INCLUDE_DIR)
 
 ADDED_CFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -65,14 +63,21 @@ USER_SOURCES += $$($(1)_SOURCES)
 .PHONY: $(2)/$(1).vxe
 $(2)/$(1).vxe:
        @$(QUIET_CMD_ECHO) "  LINK    $$@"
+# In rules.rtp (on line 265), dep generation depends on Makefile so we must create one
+#      @[ ! -f Makefile ] && touch Makefile 
+       @touch Makefile
        @echo 'EXE = $(1).vxe' > Makefile.vxe.$(1); \
        echo 'OBJS = $$($(1)_OBJS)' >> Makefile.vxe.$(1); \
        echo 'VXE_DIR = $(2)' >> Makefile.vxe.$(1); \
-       echo 'ADDED_CFLAGS += -L$(USER_LIB_DIR)' >> Makefile.vxe.$(1); \
-       echo 'ADDED_C++FLAGS += -L$(USER_LIB_DIR)' >> Makefile.vxe.$(1); \
-       echo 'ADDED_LIBS = $(lib_LOADLIBES) $$($(1)_LIBS)' >> Makefile.vxe.$(1); \
+       echo 'OBJ_DIR = $(USER_OBJS_DIR)' >> Makefile.vxe.$(1); \
+       echo 'LIB_ROOT = $(USER_LIB_DIR)' >> Makefile.vxe.$(1); \
+       echo 'OMK_LIB_PATH = $$$$(LIB_ROOT)/$$$$(VX_CPU_FAMILY)/$$$$(CPU)/$$$$(TOOL_COMMON_DIR)$$$$(LIB_DIR_TAG)/' >> Makefile.vxe.$(1); \
+       echo 'ADDED_LIBS = -L$$$$(OMK_LIB_PATH) $(lib_LOADLIBES:%=-l%) $$($(1)_LIBS:%=-l%)' >> Makefile.vxe.$(1); \
+       echo 'VPATH = $(SOURCES_DIR)' >> Makefile.vxe.$(1); \
        echo 'include $$$$(WIND_USR)/make/rules.rtp' >> Makefile.vxe.$(1); \
        $(WRENV) -p $(WRPACKAGE) $(MAKE)  CPU=$(CPU) TOOL=$(TOOL) -f Makefile.vxe.$(1)
+#      echo 'ADDED_C++FLAGS += -L$(USER_LIB_DIR)' >> Makefile.vxe.$(1); \
+#      echo 'ADDED_CFLAGS += -L$(USER_LIB_DIR)' >> Makefile.vxe.$(1); \
 #      $(Q) $$(shell if [ -z "$$(filter %.cc,$$($(1)_SOURCES:%.cxx=%.cc))" ] ; then echo $$(CC) ; else echo $$(CXX) ; fi) \
 #        $$($(1)_OBJS) $$($(1)_LIBS:%=-l%) $$(LOADLIBES) $$(LDFLAGS) -Wl,-Map,$(USER_OBJS_DIR)/$(1).exe.map -o $(2)/$(1)
 #      @echo "$(2)/$(1): \\" >$(USER_OBJS_DIR)/$(1).exe.d
@@ -106,6 +111,7 @@ $(USER_LIB_DIR)/lib$(1).a: #$$($(1)_OBJS)
        @$(QUIET_CMD_ECHO) "  LIB     $$@"
        @echo 'LIB_BASE_NAME = $(1)' > Makefile.lib.$(1); \
        echo 'OBJS = $$($(1)_OBJS)' >> Makefile.lib.$(1); \
+       echo 'OBJ_DIR = $(USER_OBJS_DIR)' >> Makefile.lib.$(1); \
        echo 'LIB_ROOT = $(USER_LIB_DIR)' >> Makefile.lib.$(1); \
        echo 'VPATH = $(SOURCES_DIR)' >> Makefile.lib.$(1); \
        echo 'include $$$$(WIND_USR)/make/rules.library' >> Makefile.lib.$(1); 
index 67e01637b2afce8a63264e1b2f7e836e9f653157..817974bf7715fadc744993cdeac64c6bfd0520dd 100644 (file)
@@ -3,16 +3,16 @@
 # variables: WIND_BASE CPU TOOL
 include $(MAKERULES_DIR)/config.target
 ifndef WRENV
-$(error WRENV not defined in config.target)
+$(error WRENV is not defined in config.target)
 endif
 ifndef WRPACKAGE
-$(error WRPACKAGE not defined in config.target)
+$(error WRPACKAGE is not defined in config.target)
 endif
 ifndef CPU
-$(error CPU not defined in config.target)
+$(error CPU is not defined in config.target)
 endif
 ifndef TOOL
-$(error TOOL not defined in config.target)
+$(error TOOL is not defined in config.target)
 endif
 
 BUILD_DIR_NAME = _build/$(CPU)$(TOOL)
similarity index 52%
rename from tests/vxworks/rtp/Makefile.omk
rename to tests/vxworks/fibo-rtp/Makefile.omk
index 795d36b956a22f577fbf359c53434ded218ca94d..5807c5adab7fd08139f76d6cc50e491e9885ecce 100644 (file)
@@ -1,4 +1,4 @@
 bin_PROGRAMS = fibo2
-fibo2_SOURCES = fibo2.c
+fibo2_SOURCES = fibo2.c fiboprint.c
 fibo2_LIBS = fibo
 
similarity index 96%
rename from tests/vxworks/rtp/fibo2.c
rename to tests/vxworks/fibo-rtp/fibo2.c
index eacfc49b6ed53b9bbbca5521b9c83122006b9574..4653c0f7f25389eedc06e5ef6c32840d0c736f5d 100644 (file)
@@ -1,6 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include "fibolib.h"
+#include <fibolib.h>
 
 int
 main (int argc, char *argv[])
diff --git a/tests/vxworks/fibo-rtp/fiboprint.c b/tests/vxworks/fibo-rtp/fiboprint.c
new file mode 100644 (file)
index 0000000..e9cb3fb
--- /dev/null
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+void
+fiboprint (int *series, int n)
+{
+    while (n-- >= 0)
+       printf ("%d%c", *(series++), n >= 0 ? ' ' : '\n');
+}