get rid of project as a container of code, flatten it one level
diff --git a/makefile b/makefile
index 33cd10e..5ddfb26 100644
--- a/makefile
+++ b/makefile
@@ -54,7 +54,7 @@
# any rules you put here will be depended on in clean builds
EXTRA_CLEANDEPS :=
-include project/$(PROJECT)/rules.mk
+include project/$(PROJECT).mk
include target/$(TARGET)/rules.mk
include platform/$(PLATFORM)/rules.mk
include arch/$(ARCH)/rules.mk
diff --git a/project/armemu-test.mk b/project/armemu-test.mk
new file mode 100644
index 0000000..151beed
--- /dev/null
+++ b/project/armemu-test.mk
@@ -0,0 +1,16 @@
+# top level project rules for the armemu-test project
+#
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+TARGET := armemu
+MODULES += \
+ app/tests \
+ app/shell
+
+# extra rules to copy the armemu.conf file to the build dir
+#$(BUILDDIR)/armemu.conf: $(LOCAL_DIR)/armemu.conf
+# @echo copy $< to $@
+# $(NOECHO)cp $< $@
+
+#EXTRA_BUILDDEPS += $(BUILDDIR)/armemu.conf
+#GENERATED += $(BUILDDIR)/armemu.conf
diff --git a/project/armemu-test/armemu.conf b/project/armemu-test/armemu.conf
deleted file mode 100644
index 7eaea5d..0000000
--- a/project/armemu-test/armemu.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-[cpu]
-core = arm926ejs
-
-# the rom file is loaded at address 0x0
-[rom]
-file = lk.bin
-
-[system]
-display = no
-console = yes
-network = no
-
-[network]
-device = /dev/tap0
diff --git a/project/armemu-test/init.c b/project/armemu-test/init.c
deleted file mode 100644
index 34c32b6..0000000
--- a/project/armemu-test/init.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2008 Travis Geiselbrecht
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <app/tests.h>
-#include <lib/console.h>
-
-void project_init(void)
-{
- console_init();
- tests_init();
-
- console_start();
-}
-
diff --git a/project/armemu-test/rules.mk b/project/armemu-test/rules.mk
deleted file mode 100644
index 7808e5a..0000000
--- a/project/armemu-test/rules.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-# top level project rules for the armemu-test project
-#
-LOCAL_DIR := $(GET_LOCAL_DIR)
-
-TARGET := armemu
-MODULES += \
- app/tests \
- lib/console
-
-OBJS += \
- $(LOCAL_DIR)/init.o
-
-# extra rules to copy the armemu.conf file to the build dir
-$(BUILDDIR)/armemu.conf: $(LOCAL_DIR)/armemu.conf
- @echo copy $< to $@
- $(NOECHO)cp $< $@
-
-EXTRA_BUILDDEPS += $(BUILDDIR)/armemu.conf
-GENERATED += $(BUILDDIR)/armemu.conf
diff --git a/project/beagle-test/rules.mk b/project/beagle-test.mk
similarity index 76%
rename from project/beagle-test/rules.mk
rename to project/beagle-test.mk
index 01e6376..6f4cbec 100644
--- a/project/beagle-test/rules.mk
+++ b/project/beagle-test.mk
@@ -7,8 +7,5 @@
MODULES += \
app/tests \
app/stringtests \
- lib/console
-
-OBJS += \
- $(LOCAL_DIR)/init.o
+ app/shell
diff --git a/project/beagle-test/init.c b/project/beagle-test/init.c
deleted file mode 100644
index 313b398..0000000
--- a/project/beagle-test/init.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2008 Travis Geiselbrecht
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <debug.h>
-#include <arch/arm.h>
-#include <lib/console.h>
-#include <app/tests.h>
-#include <dev/usb.h>
-
-#include "usb_descriptors.h"
-
-static usb_config config = {
- .lowspeed = {
- .device = { dev_descr, sizeof(dev_descr) },
- .device_qual = { devqual_descr, sizeof(devqual_descr) },
- .config = { cfg_descr_lowspeed, sizeof(cfg_descr_lowspeed) },
- },
- .highspeed = {
- .device = { dev_descr, sizeof(dev_descr) },
- .device_qual = { devqual_descr, sizeof(devqual_descr) },
- .config = { cfg_descr_highspeed, sizeof(cfg_descr_highspeed) },
- },
- .langid = { langid, sizeof(langid) }
-};
-
-extern int string_tests(void);
-extern int thread_tests(void);
-
-void project_init(void)
-{
- console_init();
- tests_init();
-
- usb_init();
- usb_setup(&config);
- usb_add_string("lk, Inc.", 0x1); // manufacturer id
- usb_add_string("lk", 0x2); // device string
- usb_start();
-
- console_start();
-}
-
diff --git a/project/beagle-test/usb_descriptors.h b/project/beagle-test/usb_descriptors.h
deleted file mode 100644
index cfd499a..0000000
--- a/project/beagle-test/usb_descriptors.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2008 Travis Geiselbrecht
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#ifndef __USB_DESCRIPTORS_H
-#define __USB_DESCRIPTORS_H
-
-#include <sys/types.h>
-#include <compiler.h>
-
-#define W(w) (w & 0xff), (w >> 8)
-
-/* top level device descriptor */
-static uint8_t __ALIGNED(2) dev_descr[] = {
- 0x12, /* descriptor length */
- 0x01, /* Device Descriptor type */
- W(0x0200), /* USB Version */
- 0x00, /* class */
- 0x00, /* subclass */
- 0x00, /* protocol */
- 0x40, /* max packet size, ept0 */
- W(0x1234), /* vendor */
- W(0x5678), /* product */
- W(0x1000), /* release */
- 0x01, /* manufacturer string */
- 0x02, /* product string */
- 0x00, /* serialno string */
- 0x01, /* num configs */
-};
-
-/* high/low speed device qualifier */
-static uint8_t devqual_descr[] = {
- 0x0a, /* len */
- 0x06, /* Device Qualifier type */
- W(0x0200), /* USB version */
- 0x00, /* class */
- 0x00, /* subclass */
- 0x00, /* protocol */
- 0x40, /* max packet size, ept0 */
- 0x01, /* num configs */
- 0x00 /* reserved */
-};
-
-static uint8_t cfg_descr_lowspeed[] = {
- 0x09, /* Length of Cfg Descr */
- 0x02, /* Type of Cfg Descr */
- W(0x09), /* Total Length (incl ifc, ept) */
- 0x00, /* # Interfaces */
- 0x01, /* Cfg Value */
- 0x00, /* Cfg String */
- 0xc0, /* Attributes -- self powered */
- 0, /* Power Consumption - none */
-};
-
-static uint8_t cfg_descr_highspeed[] = {
- 0x09, /* Length of Cfg Descr */
- 0x02, /* Type of Cfg Descr */
- W(0x09), /* Total Length (incl ifc, ept) */
- 0x00, /* # Interfaces */
- 0x01, /* Cfg Value */
- 0x00, /* Cfg String */
- 0xc0, /* Attributes -- self powered */
- 0, /* Power Consumption - none */
-};
-
-static uchar langid[] __ALIGNED(2) = { 0x04, 0x03, 0x09, 0x04 };
-
-#endif
-
diff --git a/project/osk5912-test/rules.mk b/project/osk5912-test.mk
similarity index 74%
rename from project/osk5912-test/rules.mk
rename to project/osk5912-test.mk
index 4f77c2a..a72a251 100644
--- a/project/osk5912-test/rules.mk
+++ b/project/osk5912-test.mk
@@ -5,8 +5,6 @@
TARGET := osk5912
MODULES += \
app/tests \
- lib/console
-
-OBJS += \
- $(LOCAL_DIR)/init.o
+ app/stringtests \
+ app/shell
diff --git a/project/osk5912-test/armemu.conf b/project/osk5912-test/armemu.conf
deleted file mode 100644
index 7eaea5d..0000000
--- a/project/osk5912-test/armemu.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-[cpu]
-core = arm926ejs
-
-# the rom file is loaded at address 0x0
-[rom]
-file = lk.bin
-
-[system]
-display = no
-console = yes
-network = no
-
-[network]
-device = /dev/tap0
diff --git a/project/osk5912-test/init.c b/project/osk5912-test/init.c
deleted file mode 100644
index a3742c0..0000000
--- a/project/osk5912-test/init.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2008 Travis Geiselbrecht
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-#include <debug.h>
-#include <arch/arm.h>
-#include <lib/console.h>
-#include <app/tests.h>
-
-extern int string_tests(void);
-extern int thread_tests(void);
-
-void project_init(void)
-{
- console_init();
- tests_init();
-
-// console_run_command("printf_tests");
-// console_run_command("thread_tests");
-
- console_start();
-}
-
diff --git a/project/qemu-arm-test/rules.mk b/project/qemu-arm-test.mk
similarity index 72%
rename from project/qemu-arm-test/rules.mk
rename to project/qemu-arm-test.mk
index a3bfe8c..2b1403c 100644
--- a/project/qemu-arm-test/rules.mk
+++ b/project/qemu-arm-test.mk
@@ -4,8 +4,6 @@
TARGET := qemu-arm
MODULES += \
- app/tests
-
-OBJS += \
- $(LOCAL_DIR)/init.o
-
+ app/tests \
+ app/shell
+
diff --git a/project/qemu-arm-test/init.c b/project/qemu-arm-test/init.c
deleted file mode 100644
index a34f343..0000000
--- a/project/qemu-arm-test/init.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2008 Travis Geiselbrecht
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-extern int thread_tests(void);
-
-void project_init(void)
-{
- thread_tests();
-}
-
diff --git a/project/qemu-arm-test/runqemu b/project/qemu-arm-test/runqemu
deleted file mode 100755
index a34f936..0000000
--- a/project/qemu-arm-test/runqemu
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-qemu-system-arm -serial stdio -nographic -kernel build-qemu-arm-test/lk.bin
diff --git a/project/sam7ex256-test/rules.mk b/project/sam7ex256-test.mk
similarity index 74%
rename from project/sam7ex256-test/rules.mk
rename to project/sam7ex256-test.mk
index ecf391a..3bd574e 100644
--- a/project/sam7ex256-test/rules.mk
+++ b/project/sam7ex256-test.mk
@@ -4,7 +4,6 @@
TARGET := sam7ex256
MODULES += \
- app/tests
+ app/tests \
+ app/shell
-OBJS += \
- $(LOCAL_DIR)/init.o
diff --git a/project/sam7ex256-test/init.c b/project/sam7ex256-test/init.c
deleted file mode 100644
index a34f343..0000000
--- a/project/sam7ex256-test/init.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2008 Travis Geiselbrecht
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-extern int thread_tests(void);
-
-void project_init(void)
-{
- thread_tests();
-}
-
diff --git a/project/surf-test/rules.mk b/project/surf-test.mk
similarity index 81%
rename from project/surf-test/rules.mk
rename to project/surf-test.mk
index a2a9171..3e7ee8e 100644
--- a/project/surf-test/rules.mk
+++ b/project/surf-test.mk
@@ -10,8 +10,5 @@
MODULES += \
app/tests \
- lib/console
-
-OBJS += \
- $(LOCAL_DIR)/init.o
+ app/shell
diff --git a/project/surf-test/init.c b/project/surf-test/init.c
deleted file mode 100644
index 5ef05b7..0000000
--- a/project/surf-test/init.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2008, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google, Inc. nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <debug.h>
-#include <arch/arm.h>
-#include <lib/console.h>
-#include <app/tests.h>
-
-extern int string_tests(void);
-extern int thread_tests(void);
-
-#define LED0 0x9C004282
-#define LED1 0x9C004284
-
-void project_init(void)
-{
- dprintf(INFO, "project init\n");
- console_init();
- tests_init();
- console_start();
-}