summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-06-22 19:54:58 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-06-22 19:54:58 +0000
commitc2a4686c15f2ea3c55882a8e89a2ff3f17464ad7 (patch)
tree4c926de55bb8736431c17c558eddd84624540d1a
parent2007-06-22 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadnetwork-demos-c2a4686c15f2ea3c55882a8e89a2ff3f17464ad7.tar.bz2
2007-06-22 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile, init.c: Clean up. Make name of TARFILE related symbols conditional based upon architecture. Change way desired object format is determined so all BSPs compile this test.
-rw-r--r--http/ChangeLog6
-rw-r--r--http/Makefile16
-rw-r--r--http/init.c38
3 files changed, 30 insertions, 30 deletions
diff --git a/http/ChangeLog b/http/ChangeLog
index f0e4efc..cdc4fb0 100644
--- a/http/ChangeLog
+++ b/http/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-22 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * Makefile, init.c: Clean up. Make name of TARFILE related symbols
+ conditional based upon architecture. Change way desired object format
+ is determined so all BSPs compile this test.
+
2007-06-21 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile: Remove tarfile when make clean.
diff --git a/http/Makefile b/http/Makefile
index 6039c20..bd60575 100644
--- a/http/Makefile
+++ b/http/Makefile
@@ -42,7 +42,8 @@ CFLAGS_DEBUG_V += -v -qrtems_debug
LD_PATHS +=
LD_LIBS += -lhttpd
LD_LIBS += -lftpd
-NATIVE_OBJ = $(shell $(OBJCOPY) 2>&1 | grep copy: | cut -d':' -f3 | cut -d' ' -f2)
+#NATIVE_OBJ = $(shell $(OBJCOPY) 2>&1 | grep copy: | cut -d':' -f3 | cut -d' ' -f2)
+OBJDUMP=$(OBJCOPY:copy=dump)
#
# Add your list of files to delete here. The config files
@@ -51,16 +52,21 @@ NATIVE_OBJ = $(shell $(OBJCOPY) 2>&1 | grep copy: | cut -d':' -f3 | cut -d' ' -
# 'make clobber' already includes 'make clean'
#
-CLEAN_ADDITIONS += tarfile
+CLEAN_ADDITIONS += tarfile obj_format
CLOBBER_ADDITIONS +=
all: ${ARCH} $(SRCS) $(PGM)
-${PGM}: $(OBJS) $(LINK_FILES)
+obj_format:
+ $(OBJDUMP) -f $(ARCH)/init.o | grep .o: | \
+ sed -e 's/^.*format //' >obj_format
+
+${PGM}: $(OBJS) obj_format $(LINK_FILES)
cd rootfs ; tar cf ../$(ARCH)/tarfile web etc
cp $(ARCH)/tarfile .
- $(OBJCOPY) -I binary -O $(NATIVE_OBJ) tarfile $(ARCH)/tarfile.o
- $(LD) -r -o $(ARCH)/temp.o $(ARCH)/init.o $(ARCH)/tarfile.o
+ $(OBJCOPY) -I binary -O `cat obj_format` tarfile $(ARCH)/tarfile.o
+ $(LD) $(CPU_CFLAGS) -r -o $(ARCH)/temp.o \
+ $(ARCH)/init.o $(ARCH)/tarfile.o
$(MV) $(ARCH)/temp.o $(ARCH)/init.o
$(RM) $(ARCH)/temp.o
$(make-exe)
diff --git a/http/init.c b/http/init.c
index eb16971..9185078 100644
--- a/http/init.c
+++ b/http/init.c
@@ -56,30 +56,20 @@
#define ARGUMENT 0
/*
- * The tarfile is built in $(ARCH) so includes whether we were
- * built optimized or debug.
+ * The tarfile is built automatically externally so we need to account
+ * for the leading symbol on the names.
*/
-
-#if defined(USE_FTPD)
-/*
-#if defined(RTEMS_DEBUG)
-extern int _binary_o_debug_tarfile_start;
-extern int _binary_o_debug_tarfile_size;
-#define TARFILE_START _binary_o_debug_tarfile_start
-#define TARFILE_SIZE _binary_o_debug_tarfile_size
+#if defined(__sh__)
+ #define SYM(_x) _x
#else
-extern int _binary_o_optimize_tarfile_start;
-extern int _binary_o_optimize_tarfile_size;
-#define TARFILE_START _binary_o_optimize_tarfile_start
-#define TARFILE_SIZE _binary_o_optimize_tarfile_size
-#endif
-*/
-extern int _binary_tarfile_start;
-extern int _binary_tarfile_size;
-#define TARFILE_START _binary_tarfile_start
-#define TARFILE_SIZE _binary_tarfile_size
+ #define SYM(_x) _ ## _x
#endif
+extern int SYM(binary_tarfile_start);
+extern int SYM(binary_tarfile_size);
+#define TARFILE_START SYM(binary_tarfile_start)
+#define TARFILE_SIZE SYM(binary_tarfile_size)
+
#if defined(USE_FTPD)
struct rtems_ftpd_configuration rtems_ftpd_configuration = {
10, /* FTPD task priority */
@@ -96,15 +86,13 @@ rtems_task Init(
printf("\n\n*** HTTP TEST ***\n\r" );
- /* init_paging(); */
-
+ status = Untar_FromMemory((void *)(&TARFILE_START), (size_t)&TARFILE_SIZE);
+
rtems_bsdnet_initialize_network ();
#if defined(USE_FTPD)
rtems_initialize_ftpd();
-
- status = Untar_FromMemory((void *)(&TARFILE_START), (size_t)&TARFILE_SIZE);
#endif
-
+
#if defined(USE_HTTPD)
rtems_initialize_webserver();
#endif