From: <jt...@us...> - 2007-05-06 15:55:11
|
Revision: 261 http://ro-oslib.svn.sourceforge.net/ro-oslib/?rev=261&view=rev Author: jtytgat Date: 2007-05-06 08:55:08 -0700 (Sun, 06 May 2007) Log Message: ----------- Bringing the Test directory up-to-date. Modified Paths: -------------- branches/simplified-build/!OsLib/Source/Test/Test/test.c branches/simplified-build/!OsLib/Source/Test/Test/test.cc Added Paths: ----------- branches/simplified-build/!OsLib/Source/Test/Makefile branches/simplified-build/!OsLib/Source/Test/Test/Makefile branches/simplified-build/!OsLib/Source/Test/Test/small_test.s branches/simplified-build/!OsLib/Source/Test/Test/test.asm branches/simplified-build/!OsLib/Source/Test/Test/test.gas branches/simplified-build/!OsLib/Source/Test/Test1/Makefile branches/simplified-build/!OsLib/Source/Test/Test1/test.asm branches/simplified-build/!OsLib/Source/Test/Test1/test.gas branches/simplified-build/!OsLib/Source/Test/readvarval/Makefile Removed Paths: ------------- branches/simplified-build/!OsLib/Source/Test/AMUmakefile branches/simplified-build/!OsLib/Source/Test/GNUmakefile branches/simplified-build/!OsLib/Source/Test/Make,fd7 branches/simplified-build/!OsLib/Source/Test/Makefile,fe1 branches/simplified-build/!OsLib/Source/Test/Test/AMUmakefile branches/simplified-build/!OsLib/Source/Test/Test/GNUmakefile branches/simplified-build/!OsLib/Source/Test/Test/Make,fd7 branches/simplified-build/!OsLib/Source/Test/Test/Run_cc,fd7 branches/simplified-build/!OsLib/Source/Test/Test/Run_cpp,fd7 branches/simplified-build/!OsLib/Source/Test/Test/test.s branches/simplified-build/!OsLib/Source/Test/Test1/GNUmakefile branches/simplified-build/!OsLib/Source/Test/Test1/test.s branches/simplified-build/!OsLib/Source/Test/readvarval/!Run,fd7 branches/simplified-build/!OsLib/Source/Test/readvarval/AMUmakefile branches/simplified-build/!OsLib/Source/Test/readvarval/GNUmakefile branches/simplified-build/!OsLib/Source/Test/readvarval/Make,fd7 Deleted: branches/simplified-build/!OsLib/Source/Test/AMUmakefile =================================================================== --- branches/simplified-build/!OsLib/Source/Test/AMUmakefile 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/AMUmakefile 2007-05-06 15:55:08 UTC (rev 261) @@ -1,38 +0,0 @@ -# Index: OSLib/!OsLib/Source/Test/Test/AMUmakefile 20040106 -# -#------------------------------------------------------------------------ -# paths & directories -DIR = ${MAKEFILEDIR} - -#------------------------------------------------------------------------ -#tools -MAKE = amu -desktop -RM = rm -nq - -CP = copy -COPYFLAGS = A~C~DFLN~P~Q~R~S~T~V - -#------------------------------------------------------------------------ -#targets -.PHONY: all test readvarval TestFW - -all: readvarval test - -test: - ${MAKE} -f ${DIR}.Test.AMUmakefile all APCS=${APCS} - -readvarval: - ${MAKE} -f ${DIR}.readvarval.AMUmakefile all APCS=${APCS} - -TestFW: - ${MAKE} -f ${DIR}.TestFW.AMUmakefile all APCS=${APCS} - -clean: - ${MAKE} -f ${DIR}.readvarval.AMUmakefile clean - ${MAKE} -f ${DIR}.Test.AMUmakefile clean - ${MAKE} -f ${DIR}.TestFW.AMUmakefile clean - -distclean: - ${MAKE} -f ${DIR}.readvarval.AMUmakefile distclean - ${MAKE} -f ${DIR}.Test.AMUmakefile distclean - ${MAKE} -f ${DIR}.TestFW.AMUmakefile distclean Deleted: branches/simplified-build/!OsLib/Source/Test/GNUmakefile =================================================================== --- branches/simplified-build/!OsLib/Source/Test/GNUmakefile 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/GNUmakefile 2007-05-06 15:55:08 UTC (rev 261) @@ -1,16 +0,0 @@ -# Index: OSLib/!OsLib/Source/Test/GNUmakefile 20040128 -#=================================================================== - -.PHONY: all Test clean - -TESTS = Test Test1 readvarval - -all: ;$(foreach dir, ${TESTS}, set -e; ${MAKE} -C ${dir}; ) - -Test: ;${MAKE} -C $@ -Test1: ;${MAKE} -C $@ - -readvarval: ;${MAKE} -C $@ - -clean: ;$(foreach dir, ${TESTS}, ${MAKE} -C ${dir} clean; ) - Deleted: branches/simplified-build/!OsLib/Source/Test/Make,fd7 =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Make,fd7 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Make,fd7 2007-05-06 15:55:08 UTC (rev 261) @@ -1,6 +0,0 @@ -| !OSLib.Source.Test.Make 20040308 -Echo <sys$time> !OSLib.Source.Test.Make %0 -WimpSlot -min 4096k -if "<C$Mode>"= 32 then Do AMU -f <Obey$Dir>.AMUmakeFile -desktop %0 APCS=32 -if "<C$Mode>"<>32 then Do AMU -f <Obey$Dir>.AMUmakeFile -desktop %0 APCS=26 -Echo <sys$time> Done Copied: branches/simplified-build/!OsLib/Source/Test/Makefile (from rev 246, branches/simplified-build/!OsLib/Source/Test/GNUmakefile) =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Makefile (rev 0) +++ branches/simplified-build/!OsLib/Source/Test/Makefile 2007-05-06 15:55:08 UTC (rev 261) @@ -0,0 +1,9 @@ +# ... + +.PHONY: all clean + +TESTS = Test1 Test readvarval + +all: ;$(foreach dir, ${TESTS}, set -e; ${MAKE} -C ${dir}; ) + +clean: ;$(foreach dir, ${TESTS}, ${MAKE} -C ${dir} clean; ) Deleted: branches/simplified-build/!OsLib/Source/Test/Makefile,fe1 =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Makefile,fe1 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Makefile,fe1 2007-05-06 15:55:08 UTC (rev 261) @@ -1,50 +0,0 @@ -# Index: OSLib/!OsLib/Source/Test/Test/Makefile,fe1 20040106 -# -RM = OSLibBin:rm - -DIR = <OSLib$SourceDir>.Test -COPYFLAGS = A~C~DFLN~P~Q~R~S~T~V -AMU = amu -desktop - -all: readvarval test TestHDR - -stripdepends: - ${AMU} -f ${DIR}.readvarval.Makefile stripdepends - ${AMU} -f ${DIR}.Test.Makefile stripdepends - ${AMU} -f ${DIR}.TestFW.Makefile stripdepends - ${AMU} -f ${DIR}.TestHDR.Makefile stripdepends - -tree: - ${AMU} -f ${DIR}.readvarval.Makefile tree - ${AMU} -f ${DIR}.Test.Makefile tree - ${AMU} -f ${DIR}.TestFW.Makefile tree - ${AMU} -f ${DIR}.TestHDR.Makefile tree - ifthere ${DIR}.tree then stamp ${DIR}.tree else create ${DIR}.tree - -test: - ${AMU} -f ${DIR}.Test.Makefile all DIR=${DIR}.Test APCS=${APCS} OSLIB=${OSLIB} - -readvarval: - ${AMU} -f ${DIR}.readvarval.Makefile all DIR=${DIR}.readvarval APCS=${APCS} OSLIB=${OSLIB} - -TestFW: - ${AMU} -f ${DIR}.TestFW.Makefile all DIR=${DIR}.TestFW APCS=${APCS} OSLIB=${OSLIB} - -TestHDR: - ${AMU} -f ${DIR}.TestHDR.Makefile all DIR=${DIR}.TestHDR APCS=${APCS} OSLIB=${OSLIB} - -testlib: readvarval test TestHDR - -archive_source: - cdir ${ARCHIVE} - copy * ${ARCHIVE}.* ${COPYFLAGS} - ${AMU} -f ${DIR}.readvarval.makefile archive_source ARCHIVE=${ARCHIVE}.readvarval - ${AMU} -f ${DIR}.Test.makefile archive_source ARCHIVE=${ARCHIVE}.Test - ${AMU} -f ${DIR}.TestFW.makefile archive_source ARCHIVE=${ARCHIVE}.TestFW - ${AMU} -f ${DIR}.TestHDR.makefile archive_source ARCHIVE=${ARCHIVE}.TestHDR - -clean: - ${AMU} -f ${DIR}.readvarval.Makefile clean - ${AMU} -f ${DIR}.Test.Makefile clean - ${AMU} -f ${DIR}.TestFW.Makefile clean - ${AMU} -f ${DIR}.TestHDR.Makefile clean Deleted: branches/simplified-build/!OsLib/Source/Test/Test/AMUmakefile =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/AMUmakefile 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Test/AMUmakefile 2007-05-06 15:55:08 UTC (rev 261) @@ -1,122 +0,0 @@ -# Index: OSLib/!OsLib/Source/Test/Test/AMUmakefile 20031230 -#=================================================================== - -#------------------------------------------------------------------------ -# paths & directories -SOURCEDIR = <OSLib$SourceDir> -#BINDIR = ${SOURCEDIR}/../Bin - -#------------------------------------------------------------------------ -# Macros -#------------------------------------------------------------------------ -#target-specific macros -SOURCES_0 = Computer Core Toolbox User -SOURCES = ${SOURCES_0} Types Macros -CONTENTS = $(addsuffix .oslib.Modules, $(addprefix ${SOURCEDIR}., ${SOURCES_0}) ) -OSLIB = ${SOURCEDIR}.o.OSLib -OSLIB32 = ${SOURCEDIR}.o.OSLib32 -OSLIB_H = h.oslib -OSLIB_HDR = Hdr.OSLib - -#LIBS_S = OSLibSupport:OSLibSupport.o -#LIBS_OS = OSLib:o.OSLib -#LIBS_GPP = -liostream -#LIBS_C = C:o.stubs -#LIBS_CPP = C:o.C++Lib C:o.Stubs - -ifeq (APCS,32) -OS_LIB = ${OSLIB32} -else -OS_LIB = ${OSLIB} -endif - -.include ${CONTENTS} - -#------------------------------------------------------------------------ -# tools -MAKE = amu -desktop APCS=${APCS} - -FLAGS_CC = fah -#DEP = -depend !depend -CC = cc -apcs 3/${APCS} ${DEP} -f${FLAGS_CC} -throwback - -CPP = c++ -apcs 3/${APCS} -c -throwback -GCC = gcc -mthrowback -GPP = gcc -xc++ -mthrowback -AS = do objasm -LD = Link -RM = rm -nq -MD = cdir -STRIP = StripDepends - -CP = copy -COPYFLAGS = A~C~DFLN~P~Q~R~S~T~V - -#------------------------------------------------------------------------ -# Targets: -.PHONY: all clean - -TEST_C = test_c -TEST_CPP = test_cpp -TEST_S = test_s - -BIN_C = ${TEST_C} -BIN_CPP = ${TEST_CPP} -BIN_S = ${TEST_S} - -all: ${BIN_CPP} ${BIN_C} ${BIN_S} - -${OSLIB_H}: ${CONTENTS} mkhdr - ${MD} h - @/${MAKEFILEDIR}.mkhdr -c $@ $(sort ${MODULES} ${SWIMODULES} Types Macros) - -${OSLIB_HDR}: ${CONTENTS} mkhdr - ${MD} Hdr - @/${MAKEFILEDIR}.mkhdr -s $@ $(sort ${MODULES} ${SWIMODULES} Types Macros) - -mkhdr: mkhdr.c - ${MD} o - ${CC} -o $@ mkhdr.c - -${TEST_S}.o: test.s ${OSLIB_HDR} - ${MD} o - ${AS} -c test.s -o $@ -I <OSLib$Path> - -${BIN_S}: ${TEST_S}.o ${OS_LIB} - ${LD} ${TEST_S}.o -o $@ - /${MAKEFILEDIR}.$@ - -${TEST_C}.o: test.c ${OSLIB_H} - ${MD} o - ${CC} -c test.c -IC:,OSLib: -o $@ - -${BIN_C}: ${TEST_C}.o ${OS_LIB} - ${LD} ${TEST_C}.o C:stubs.o ${OS_LIB} -o $@ - /${MAKEFILEDIR}.$@ - -${TEST_CPP}.o: cc.test ${OSLIB_H} - ${MD} o - ${CPP} -c cc.test -IC:,OSLib: -o $@ - -${BIN_CPP}: ${TEST_CPP}.o ${OS_LIB} - ${LD} -C++ $? C:C++Lib.o C:stubs.o -o $@ - /${MAKEFILEDIR}.$@ - -clean: ;-${RM} \ -${BIN_C} \ -o.${TEST_C} \ -${BIN_CPP} \ -o.${TEST_CPP} \ -${BIN_S} \ -o.${TEST_S} \ -${OSLIB_H} \ -${OSLIB_Hdr} \ -mkhdr \ -o.mkhdr - -distclean: clean - ${RM} o Hdr h - - -#------------------------------------------------------------------------ -# Dynamic dependencies: Deleted: branches/simplified-build/!OsLib/Source/Test/Test/GNUmakefile =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/GNUmakefile 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Test/GNUmakefile 2007-05-06 15:55:08 UTC (rev 261) @@ -1,88 +0,0 @@ -# Index: OSLib/!OsLib/Source/Test/Test/GNUmakefile 20040121 -#=================================================================== - -#------------------------------------------------------------------------ -# paths & directories -SOURCEDIR = ../.. -include ${SOURCEDIR}/GNUmakefile.settings -include ${SOURCEDIR}/../GNUmakefile.settings - -#------------------------------------------------------------------------ -#target-specific macros -SOURCES_0 = Computer Core Toolbox User -SOURCES = ${SOURCES_0} Types Macros -CONTENTS = $(addsuffix /oslib/Modules, $(addprefix ${SOURCEDIR}/, ${SOURCES_0}) ) -OSLIB = ${SOURCEDIR}/OSLib.o -OSLIB32 = ${SOURCEDIR}/OSLib32.o -OSLIB_H = oslib.h -OSLIB_HH = OSLib.Hdr - -INCLUDES = $(addprefix -I${SOURCEDIR}/, ${SOURCES} ) - -ASOPTIONS = $(shell echo -objasm -apcs32 $(addprefix -I${SOURCEDIR}/, ${SOURCES} ) | \ - sed 's/ /,/g' ) - -#------------------------------------------------------------------------ -# tools -AS = ${GCCSDK_INSTALL_CROSSBIN}/gcc -xassembler -Wa,${ASOPTIONS} -GCC = ${GCCSDK_INSTALL_CROSSBIN}/gcc -GPP = ${GCCSDK_INSTALL_CROSSBIN}/g++ -LD = ${GCCSDK_INSTALL_CROSSBIN}/gcc -RM = rm -f - -include ${CONTENTS} - -#------------------------------------------------------------------------ -# Targets: -.PHONY: all clean - -TEST_C = test_c -TEST_CPP = test_cpp -TEST_S = test_s - -BIN_C = ${TEST_C},ff8 -BIN_CPP = ${TEST_CPP},ff8 -BIN_S = ${TEST_S},ff8 - -all: ${BIN_C} ${BIN_CPP} ${BIN_S} - -${OSLIB_H}: ${CONTENTS} - @echo ${MODULES} ${SWIMODULES} | \ - tr '[A-Z] ' '[a-z]\n' | \ - sed 's/.*/#include \"oslib\/&.h\"/g' \ - > $@ - -${OSLIB_HH}: ${CONTENTS} - @echo $(sort ${MODULES} ${SWIMODULES} Types Macros) | \ - tr ' ' '\n' | \ - sed 's/.*/@GET@oslib\/&.Hdr/g' | \ - tr '@' '\t' \ - > $@ - -${TEST_S}.o: test.s ${OSLIB_HH} - ${AS} -c $< -o $@ - -${BIN_S}: ${TEST_S}.o ${OSLIB} - ${LD} $^ -o $@ - -${TEST_C}.o: test.c ${OSLIB_H} - ${GCC} -c $< ${INCLUDES} -o $@ - -${BIN_C}: ${TEST_C}.o ${OSLIB} - ${LD} $^ -o $@ - -${TEST_CPP}.o: test.cc ${OSLIB_H} - ${GPP} -c $< ${INCLUDES} -o $@ - -${BIN_CPP}: ${TEST_CPP}.o ${OSLIB} - ${GPP} $^ -o $@ - -clean: ;-${RM} \ -${BIN_C} \ -${TEST_C}.o \ -${BIN_CPP} \ -${TEST_CPP}.o \ -${BIN_S} \ -${TEST_S}.o \ -${OSLIB_H} \ -${OSLIB_HH} Deleted: branches/simplified-build/!OsLib/Source/Test/Test/Make,fd7 =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/Make,fd7 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Test/Make,fd7 2007-05-06 15:55:08 UTC (rev 261) @@ -1,7 +0,0 @@ -| Test the Development Library Build -| -Echo <sys$time> Building <Obey$Dir> -Wimpslot 4000k -if "<C$Mode>"= 32 then Do AMU -D -f <Obey$Dir>.AMUmakefile -desktop %0 APCS=32 -if "<C$Mode>"<>32 then Do AMU -D -f <Obey$Dir>.AMUmakefile -desktop %0 APCS=26 -echo <sys$time> done \ No newline at end of file Added: branches/simplified-build/!OsLib/Source/Test/Test/Makefile =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/Makefile (rev 0) +++ branches/simplified-build/!OsLib/Source/Test/Test/Makefile 2007-05-06 15:55:08 UTC (rev 261) @@ -0,0 +1,31 @@ +# ... + +ALL_CHEADERS := $(wildcard $(HEADERDIR)/*.h) +ALL_ASMHEADERS := $(wildcard $(HEADERDIR)/*.Hdr) + +.PHONY: all clean + +all: test_c test_cpp test_s + +clean: + -$(RM) test_c test_cpp test_s all_oslib.h all_oslib.Hdr + +test_c: test.c small_test.o all_oslib.h + $(CC) -o $@ -I$(TOPHEADERDIR) test.c small_test.o $(OSLIBLIB) + +test_cpp: test.cc all_oslib.h + $(CXX) -o $@ -I$(TOPHEADERDIR) $< $(OSLIBLIB) + +test_s: test$(ASMEXT) all_oslib.Hdr + $(AS) -o $@ -I$(TOPHEADERDIR) $< + +small_test.o: small_test.s all_oslib.Hdr + $(AS) -o $@ -I$(TOPHEADERDIR) $< + +all_oslib.h: $(ALL_CHEADERS) + -$(RM) $@ + cat $(ALL_CHEADERS) > all_oslib.h + +all_oslib.Hdr: $(ALL_ASMHEADERS) + -$(RM) $@ + cat $(ALL_ASMHEADERS) > all_oslib.Hdr Deleted: branches/simplified-build/!OsLib/Source/Test/Test/Run_cc,fd7 =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/Run_cc,fd7 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Test/Run_cc,fd7 2007-05-06 15:55:08 UTC (rev 261) @@ -1,3 +0,0 @@ -echo Test_c -run <Obey$Dir>.test_c - Deleted: branches/simplified-build/!OsLib/Source/Test/Test/Run_cpp,fd7 =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/Run_cpp,fd7 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Test/Run_cpp,fd7 2007-05-06 15:55:08 UTC (rev 261) @@ -1,4 +0,0 @@ -echo Test_cpp -run <Obey$Dir>.test_cpp - - Added: branches/simplified-build/!OsLib/Source/Test/Test/small_test.s =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/small_test.s (rev 0) +++ branches/simplified-build/!OsLib/Source/Test/Test/small_test.s 2007-05-06 15:55:08 UTC (rev 261) @@ -0,0 +1,69 @@ +#include "oslib/OSGBPB.Hdr" +#include "oslib/Macros.Hdr" + + .text + + @ void EnumCSD (void); + .global EnumCSD +EnumCSD: + STMFD R13!, {R4-R11, R14} + MOV R4, #0 +loop: + MOV R0, #OSGBPB_DirEntriesInfoStamped + LDR R1, =dirname + LDR R2, =buffer + MOV R3, #10 + MOV R5, #endbuffer - buffer + LDR R6, =wildcard + SWI OS_GBPB + CMP R4, #-1 + LDMEQ R13!, {R4-R11, PC} + + TEQ R3, #0 +printloop: + BEQ loop + + LDR R0, [R2, #OSGBPB_InfoStampedBase_size] + BL PrintHex + + ADD R2, R2, #OSGBPB_InfoStampedBase + MOV R0, R2 + SWI OS_Write0 + SWI OS_NewLine + @ Skip object name: +skipname: + LDRB R14, [R2], #1 + TEQ R14, #0 + BNE skipname + Align , R2, R2 + + SUBS R3, R3, #1 + B printloop + +dirname: + .asciz "@" +wildcard: + .asciz "*" + .align + + @ R0 = hex address to be printed +PrintHex: + STMFD R13!, {R0-R7, R14} + ADR R1, PrintHexBuffer + MOV R2, #PrintHexBufferEnd - PrintHexBuffer + SWI OS_ConvertHex8 + ADR R0, PrintHexBuffer + SWI OS_Write0 + SWI OS_NewLine + LDMFD R13!, {R0-R7, PC} +PrintHexBuffer: + .space 16 +PrintHexBufferEnd: + .align + + .bss +buffer: + .space 256 +endbuffer: + + .end Copied: branches/simplified-build/!OsLib/Source/Test/Test/test.asm (from rev 246, branches/simplified-build/!OsLib/Source/Test/Test/test.s) =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/test.asm (rev 0) +++ branches/simplified-build/!OsLib/Source/Test/Test/test.asm 2007-05-06 15:55:08 UTC (rev 261) @@ -0,0 +1,28 @@ +;test assembler headers + ; faffing about with directory name to get ObjAsm to behave properly + GET ../Test/OSLib.Hdr ; gets all OSLib headers +; GET Hdr.OSLib ; alternative format for OBJASM + + EXPORT |entry| + EXPORT |exit| + + AREA code, CODE + ENTRY + +|entry| SWI XOS_GetEnv ; get the environment + MOVVS pc, lr ; exit on error + + MOV sp, r1 ; set up a stack + + STMFD sp!, {lr} ; save the return address + + ADR R0, message ; write the message std out + SWI OS_Write0 + + SWI OS_NewLine + +|exit| ldmfd sp!, {pc} ; return + +message = "Hello World from ObjAsm",0 + + END Modified: branches/simplified-build/!OsLib/Source/Test/Test/test.c =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/test.c 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Test/test.c 2007-05-06 15:55:08 UTC (rev 261) @@ -16,14 +16,13 @@ typedef unsigned char bool; /* should be allowed */ #endif -#if 1 - #include "oslib.h" -#else - #include "OSLib:os.h" -#endif +/* Load all OSLib C headers as one big header to catch potentional clashes. */ +#include "all_oslib.h" #define BUF_SIZ 64 +extern void EnumCSD(void); + int main (void) { #if defined TEST_BOOL @@ -34,23 +33,23 @@ #if defined __CC_NORCROFT os_write0( "Hello World from Norcroft\n\r" ); -#endif - -#if defined __GNUC__ +#elif defined __GNUC__ os_write0( "Hello World from GCC\n\r" ); +#else + os_write0( "Hello world from Unidentifiecd Compiler\n\r" ); #endif #if defined TEST_BOOL os_writec( '\n' ); os_write0( "BOOL_DEFINED is " ); -#if !defined BOOL_DEFINED +# if !defined BOOL_DEFINED os_write0( "not " ); -#endif +# endif os_write0( "defined\r\n" ); -#if defined BOOL_IS_OSBOOL +# if defined BOOL_IS_OSBOOL os_write0( "bool is osbool\r\n" ); -#endif +# endif os_binary_to_decimal( sizeof( kirk ), buf, BUF_SIZ-1 ); os_write0( "size of bool is " ); @@ -65,5 +64,7 @@ os_writec( '\r' ); #endif + EnumCSD(); + return 0; } Modified: branches/simplified-build/!OsLib/Source/Test/Test/test.cc =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/test.cc 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Test/test.cc 2007-05-06 15:55:08 UTC (rev 261) @@ -10,17 +10,22 @@ typedef unsigned char bool; // accepted under CFront; faulted under g++ #endif -#include "oslib.h" - #ifdef __CC_NORCROFT -#include <iostream.h> +# include <stdlib.h> +# include <iostream.h> +# define STDNAMESPACE #else -#include <iostream> +# include <cstdlib> +# include <iostream> +# define STDNAMESPACE std:: #endif +/* Load all OSLib C headers as one big header to catch potentional clashes. */ +#include "all_oslib.h" + #if defined NAMESPACE_OSLIB // using namespaces - #define TEST Test:: +# define TEST Test:: namespace Test { /* a function in our local namespace */ @@ -31,53 +36,52 @@ } } - #if 1 +# if 1 // use the |using| directive - #define OSLIB - using namespace OSLib; - #else +# define OSLIB + using namespace OSLib; +# else // use qualifiers - #define OSLIB OSLib:: - #endif +# define OSLIB OSLib:: +# endif #else // no namespaces - #define OSLIB +# define OSLIB #endif int main() { - #if defined __CC_NORCROFT const char* text = "Hello world from Norcroft via CFront"; #elif defined __GNUC__ - const char* text = "Hello world from GPP"; + const char* text = "Hello world from G++"; #else const char* text = "Hello world from Unidentifiecd Compiler"; #endif #if defined TEST_BOOL OSLIB os_write0( "__cplusplus is " ); - #if !defined __cplusplus +# if !defined __cplusplus OSLIB os_write0( "not " ); - #endif +# endif OSLIB os_write0( "defined\r\n" ); OSLIB os_write0( "\nBOOL_DEFINED is " ); - #if !defined BOOL_DEFINED +# if !defined BOOL_DEFINED OSLIB os_write0( "not " ); - #endif +# endif OSLIB os_write0( "defined\r\n" ); OSLIB os_write0( "bool is " ); -#if !defined BOOL_IS_OSBOOL +# if !defined BOOL_IS_OSBOOL OSLIB os_write0( "not " ); -#endif +# endif OSLIB os_write0( "osbool\r\n" ); OSLIB os_write0( "NAMESPACE_OSLIB is " ); - #if !defined NAMESPACE_OSLIB +# if !defined NAMESPACE_OSLIB OSLIB os_write0( "not " ); - #endif +# endif OSLIB os_write0( "defined\r\n" ); bool spock = TRUE; @@ -88,14 +92,14 @@ int used; used = OSLIB os_binary_to_decimal( sizeof( spock ), buf, BUF_SIZ-1 ); - *(buf+used) = '\0'; + buf[used] = '\0'; OSLIB os_write0( "size of bool is " ); OSLIB os_write0( buf ); OSLIB os_writec( '\n' ); OSLIB os_writec( '\r' ); used = OSLIB os_binary_to_decimal( sizeof( kirk ), buf, BUF_SIZ-1 ); - *(buf+used) = '\0'; + buf[used] = '\0'; OSLIB os_write0( "size of osbool is " ); OSLIB os_write0( buf ); OSLIB os_writec( '\n' ); @@ -103,11 +107,7 @@ #endif // just to prove it's C++ -#ifndef __CC_NORCROFT - std:: -#endif - cout << text << "\n"; + STDNAMESPACE cout << text << STDNAMESPACE endl; - return 0; - } - + return EXIT_SUCCESS; +} Copied: branches/simplified-build/!OsLib/Source/Test/Test/test.gas (from rev 246, branches/simplified-build/!OsLib/Source/Test/Test/test.s) =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/test.gas (rev 0) +++ branches/simplified-build/!OsLib/Source/Test/Test/test.gas 2007-05-06 15:55:08 UTC (rev 261) @@ -0,0 +1,27 @@ +@ Test assembler headers + +@ Gets all OSLib headers: +#include "all_oslib.Hdr" + + .text + .global entry + +entry: SWI XOS_GetEnv @ get the environment + sWIVS OS_GenerateError @ exit on error + + MOV sp, r1 @ set up a stack + + STMFD sp!, {lr} @ save the return address + + ADR R0, message @ write the message std out + SWI OS_Write0 + SWI OS_NewLine + + ldmfd sp!, {lr} @ return +exit: + SWI OS_Exit + +message: + .asciz "Hello World from GNU assembler" + + .end Deleted: branches/simplified-build/!OsLib/Source/Test/Test/test.s =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test/test.s 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Test/test.s 2007-05-06 15:55:08 UTC (rev 261) @@ -1,29 +0,0 @@ -;test assembler headers - ; faffing about with directory name to get ObjAsm to behave properly - GET ../Test/OSLib.Hdr ; gets all OSLib headers -; GET Hdr.OSLib ; alternative format for OBJASM - - EXPORT |entry| - EXPORT |exit| - - AREA code, CODE - ENTRY - -|entry| SWI XOS_GetEnv ; get the environment - MOVVS pc, lr ; exit on error - - MOV sp, r1 ; set up a stack - - STMFD sp!, {lr} ; save the return address - - ADR R0, message ; write the message std out - SWI OS_Write0 - - SWI OS_NewLine - -|exit| ldmfd sp!, {pc} ; return - -message = "Hello World from ObjAsm",0 - - END - Deleted: branches/simplified-build/!OsLib/Source/Test/Test1/GNUmakefile =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test1/GNUmakefile 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Test1/GNUmakefile 2007-05-06 15:55:08 UTC (rev 261) @@ -1,69 +0,0 @@ -# Index: OSLib/!OsLib/Source/Test/Test1/GNUmakefile 20040504 -#=================================================================== -# $Header$ - -#------------------------------------------------------------------------ -# paths & directories -SOURCEDIR = ../.. -include ${SOURCEDIR}/GNUmakefile.settings -include ${SOURCEDIR}/../GNUmakefile.settings - -#------------------------------------------------------------------------ -#target-specific macros -SOURCES_0 := Computer Core Toolbox User -SOURCES := ${SOURCES_0} Types Macros -CONTENTS := $(addsuffix /oslib/Modules, $(addprefix ${SOURCEDIR}/, ${SOURCES_0}) ) -OSLIB := ${SOURCEDIR}/OSLib.o -OSLIB32 := ${SOURCEDIR}/OSLib32.o -OSLIB_H := oslib.h -OSLIB_HH := OSLib.Hdr - -INCLUDES := $(addprefix -I${SOURCEDIR}/, ${SOURCES} ) - -ASOPTIONS := $(shell echo -objasm -apcs32 $(addprefix -I${SOURCEDIR}/, ${SOURCES} ) | \ - sed 's/ /,/g' ) - -#------------------------------------------------------------------------ -# tools -AS = ${GCCSDK_INSTALL_CROSSBIN}/gcc -xassembler -Wa,${ASOPTIONS} -GCC = ${GCCSDK_INSTALL_CROSSBIN}/gcc -GPP = ${GCCSDK_INSTALL_CROSSBIN}/g++ -LD = ${GCCSDK_INSTALL_CROSSBIN}/gcc -RM = rm -f - -tolower = $(shell echo $(1) | tr '[A-Z]' '[a-z]';) - -#------------------------------------------------------------------------ -include ${CONTENTS} - -VPATH := $(addsuffix /oslib/, $(addprefix ${SOURCEDIR}/, ${SOURCES_0}) ) - -#------------------------------------------------------------------------ -# Targets: -.PHONY: all clean - -TEST_C = test.c -TEST_CPP = test.cpp -TEST_S = test.s - -OBJS := $(addsuffix .o, ${SWIMODULES} ${MODULES}) -OBJ_C := $(addprefix c_, $(call tolower, ${OBJS})) -OBJ_S := $(addprefix s_, ${OBJS}) - -all: ${OBJ_C} ${OBJ_S} -test_c: ${OBJ_C} -test_s: ${OBJ_S} - -c_%.o: %.h - @echo "Testing $(subst .o,.h,$(subst c_,,$@))" - @echo "#include \"oslib/$(subst .o,.h,$(subst c_,,$@))\"" >> include.h - @${GCC} -c ${TEST_C} ${INCLUDES} -o /dev/null - @touch $@ - -s_%.o: %.Hdr - @echo "Testing $(subst .o,.Hdr,$(subst s_,,$@))" - @echo " GET oslib/$(subst .o,.Hdr,$(subst s_,,$@))" >> include.Hdr - @${AS} -c ${TEST_S} -o /dev/null - @touch $@ - -clean: ;-${RM} include.h include.Hdr c_*.o s_*.o Copied: branches/simplified-build/!OsLib/Source/Test/Test1/Makefile (from rev 246, branches/simplified-build/!OsLib/Source/Test/Test1/GNUmakefile) =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test1/Makefile (rev 0) +++ branches/simplified-build/!OsLib/Source/Test/Test1/Makefile 2007-05-06 15:55:08 UTC (rev 261) @@ -0,0 +1,39 @@ +# ... + +ALL_CHEADERS := $(wildcard $(HEADERDIR)/*.h) +ALL_ASMHEADERS := $(wildcard $(HEADERDIR)/*.Hdr) + +.PHONY: all clean + +TEST_C = test.c +TEST_S = test$(ASMEXT) + +OBJ_C := $(addprefix c_, $(addsuffix .o, $(basename $(notdir $(ALL_CHEADERS))))) +OBJ_S := $(addprefix s_, $(addsuffix .o, $(basename $(notdir $(ALL_ASMHEADERS))))) + +all: $(OBJ_C) $(OBJ_S) + +.SUFFIXES: +.SUFFIXES: .o .h .Hdr + +c_%.o: $(HEADERDIR)/%.h + @echo "Testing $(subst .o,.h,$(subst c_,,$@))" + @echo "#include \"oslib/$(subst .o,.h,$(subst c_,,$@))\"" > include.h + @$(CC) -c $(TEST_C) -I$(TOPHEADERDIR) -o /dev/null + @touch $@ + +ifeq ($(BUILDTYPE),CROSSGCC_ELF) +s_%.o: $(HEADERDIR)/%.Hdr + @echo "Testing $(subst .o,.Hdr,$(subst s_,,$@))" + @echo "#include \"oslib/$(subst .o,.Hdr,$(subst s_,,$@))\"" > include.Hdr + @$(AS) $(TEST_S) -I$(TOPHEADERDIR) -o /dev/null + @touch $@ +else +s_%.o: $(HEADERDIR)/%.Hdr + @echo "Testing $(subst .o,.Hdr,$(subst s_,,$@))" + @echo " GET oslib/$(subst .o,.Hdr,$(subst s_,,$@))" > include.Hdr + @$(AS) $(TEST_S) -I$(TOPHEADERDIR) -o /dev/null + @touch $@ +endif + +clean: ;-$(RM) include.h include.Hdr c_*.o s_*.o Copied: branches/simplified-build/!OsLib/Source/Test/Test1/test.asm (from rev 246, branches/simplified-build/!OsLib/Source/Test/Test1/test.s) =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test1/test.asm (rev 0) +++ branches/simplified-build/!OsLib/Source/Test/Test1/test.asm 2007-05-06 15:55:08 UTC (rev 261) @@ -0,0 +1,13 @@ +;test each assembler header + ; faffing about with directory name to get ObjAsm to behave properly + GET ../Test1/include.Hdr ; gets all OSLib headers + + EXPORT |entry| + + AREA code, CODE + ENTRY + +|entry| MOV pc, lr ; exit on error + + END + Copied: branches/simplified-build/!OsLib/Source/Test/Test1/test.gas (from rev 246, branches/simplified-build/!OsLib/Source/Test/Test1/test.s) =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test1/test.gas (rev 0) +++ branches/simplified-build/!OsLib/Source/Test/Test1/test.gas 2007-05-06 15:55:08 UTC (rev 261) @@ -0,0 +1,10 @@ +@ Test each assembler header individually + +#include "include.Hdr" + + .text + + .global entry +entry: MOV pc, lr + + .end Deleted: branches/simplified-build/!OsLib/Source/Test/Test1/test.s =================================================================== --- branches/simplified-build/!OsLib/Source/Test/Test1/test.s 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/Test1/test.s 2007-05-06 15:55:08 UTC (rev 261) @@ -1,13 +0,0 @@ -;test each assembler header - ; faffing about with directory name to get ObjAsm to behave properly - GET ../Test1/include.Hdr ; gets all OSLib headers - - EXPORT |entry| - - AREA code, CODE - ENTRY - -|entry| MOV pc, lr ; exit on error - - END - Deleted: branches/simplified-build/!OsLib/Source/Test/readvarval/!Run,fd7 =================================================================== --- branches/simplified-build/!OsLib/Source/Test/readvarval/!Run,fd7 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/readvarval/!Run,fd7 2007-05-06 15:55:08 UTC (rev 261) @@ -1 +0,0 @@ -/<obey$Dir>.readvarval \ No newline at end of file Deleted: branches/simplified-build/!OsLib/Source/Test/readvarval/AMUmakefile =================================================================== --- branches/simplified-build/!OsLib/Source/Test/readvarval/AMUmakefile 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/readvarval/AMUmakefile 2007-05-06 15:55:08 UTC (rev 261) @@ -1,73 +0,0 @@ -# Index: OSLib/!OsLib/Source/Test/readvarval/AMUmakefile,fe1 -#=================================================================== - -TARGET = readvarval -OBJS = o.${TARGET} -TRACEOBJS = -DIR = ${MAKEFILEDIR} -TRACE ?= 0 -LIBS_C = C:o.stubs - -ifeq (${APCS},32) -OS_LIB = OSLib:OSLib32.o -else -OS_Lib = OSLib:OSLib.o -endif - -ifneq (${TRACE},0) -OBJS += ${TRACEOBJS} -endif - -ifndef APCS -$(error APCS mode is undefined) -endif - -#------------------------------------------------------------------------ -#Tools -LINK = Link -CC = cc -apcs 3/${APCS} ${DEPEND} -c -f${FLAGS_CC} \ - -throwback ${INC} $(addprefix -D, ${DEFINE}) -ASM = objasm -throwback -RM = rm -nq -STRIP = stripdepends -MD = cdir -MAKE = AMU -desktop - -#------------------------------------------------------------------------ -#Toolflags -COPYFLAGS = A~C~DFLN~P~Q~R~S~T~V -INC = -IC:,OSLib: -FLAGS_CC = fah -DEFINE = -#DEPEND = - -ifdef OUTPUT -DEFINE += OUTPUT=${OUTPUT} -endif - -#------------------------------------------------------------------------ -.PHONY: all run clean distclean - -all: ${TARGET} - -${TARGET}: ${OBJS} ${LIBS_C} ${OS_LIB} - ${LINK} -output $@ ${OBJS} ${LIBS_C} ${OS_LIB} - ${MAKE} -f ${MAKEFILEDIR}.AMUmakefile run - -run: ${TARGET} - /${MAKEFILEDIR}.${TARGET} - -clean: ;${RM} ${OBJS} ${TARGET} - -distclean: clean - -${STRIP} AMUmakefile - ${RM} o - -#------------------------------------------------------------------------ -#General rules -.SUFFIXES: .o .c - -.c.o: ;${MD} o - ${CC} $< -o $@ - -# Dynamic dependencies: Deleted: branches/simplified-build/!OsLib/Source/Test/readvarval/GNUmakefile =================================================================== --- branches/simplified-build/!OsLib/Source/Test/readvarval/GNUmakefile 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/readvarval/GNUmakefile 2007-05-06 15:55:08 UTC (rev 261) @@ -1,49 +0,0 @@ -# Index: OSLib/!OsLib/Source/Test/readvarval/GNUmakefile -#=================================================================== - -#------------------------------------------------------------------------ -# paths & directories -SOURCEDIR = ../.. -include ${SOURCEDIR}/GNUmakefile.settings -include ${SOURCEDIR}/../GNUmakefile.settings - -#------------------------------------------------------------------------ -#target-specific macros -TARGET = readvarval -OBJS = ${TARGET}.o -BIN = ${TARGET},ff8 -OSLIB = ${SOURCEDIR}/OSLib.o -OSLIB32 = ${SOURCEDIR}/OSLib32.o - -SOURCES = Computer Core Toolbox User Types Macros -INCLUDES = $(addprefix -I${SOURCEDIR}/, ${SOURCES} ) - - -#------------------------------------------------------------------------ -#Tools -GCC = ${GCCSDK_INSTALL_CROSSBIN}/gcc -LD = ${GCCSDK_INSTALL_CROSSBIN}/gcc -RM = rm -f - -#------------------------------------------------------------------------ -#Toolflags - -#------------------------------------------------------------------------ -# Targets -.PHONY: all clean - -all: ${BIN} - -${BIN}: ${OBJS} ${OSLIB32} - ${LD} -o $@ $^ - -clean: - -${RM} ${OBJS} ${BIN} - -#------------------------------------------------------------------------ -#General rules -.SUFFIXES: .o .c - -.c.o: - ${GCC} -c ${INCLUDES} $< -o $@ - Deleted: branches/simplified-build/!OsLib/Source/Test/readvarval/Make,fd7 =================================================================== --- branches/simplified-build/!OsLib/Source/Test/readvarval/Make,fd7 2007-05-05 21:29:20 UTC (rev 260) +++ branches/simplified-build/!OsLib/Source/Test/readvarval/Make,fd7 2007-05-06 15:55:08 UTC (rev 261) @@ -1,5 +0,0 @@ -Echo <Sys$Time> Building <Obey$Dir> -Wimpslot 4096k -if "<C$Mode>"="32" then do AMU -D -f <Obey$Dir>.AMUmakefile -desktop %0 APCS=32 OUTPUT=1 -if "<C$Mode>"<>"32" then do AMU -D -f <Obey$Dir>.AMUmakefile -desktop %0 APCS=26 OUTPUT=1 -echo <sys$time> done \ No newline at end of file Copied: branches/simplified-build/!OsLib/Source/Test/readvarval/Makefile (from rev 246, branches/simplified-build/!OsLib/Source/Test/readvarval/GNUmakefile) =================================================================== --- branches/simplified-build/!OsLib/Source/Test/readvarval/Makefile (rev 0) +++ branches/simplified-build/!OsLib/Source/Test/readvarval/Makefile 2007-05-06 15:55:08 UTC (rev 261) @@ -0,0 +1,16 @@ +# ... + +.PHONY: all clean + +all: readvarval + +clean: + -$(RM) readvarval readvarval.o + +readvarval: readvarval.o $(OSLIBLIB) + $(CC) -o $@ $^ + +.SUFFIXES: .o .c + +.c.o: + $(CC) -I$(TOPHEADERDIR) -c $< -o $@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |