diff --git a/src/Makefile b/src/Makefile index 0a98025..e052c98 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,6 +3,8 @@ _ARCH?= ${MACHINE_ARCH} +_ARCH=i386 + MAKE=make OBJ_DIR?= ${CURDIR}/obj @@ -24,7 +26,7 @@ WORLD_INC=${CURDIR}/include.new WORLD_FLAGS=_ARCH=${_ARCH} CC="cc" CXX="c++" AS="as" AR="ar" LD="ld" NM=nm OBJDUMP= OBJCOPY="objcopy" RANLIB=ranlib -WMAKE= ${MAKE} ${WORLD_FLAGS} INCLUDE=${WORLD_INC} BUILD_DIR=../build +WMAKE= ${MAKE} ${WORLD_FLAGS} INCLUDE=${WORLD_INC} BUILD_DIR=${CURDIR}/build TMP_PATH=${PATH} ROOT=/ubixos diff --git a/src/bin/Makefile.inc b/src/bin/Makefile.inc index 2101f00..2d0ca5d 100644 --- a/src/bin/Makefile.inc +++ b/src/bin/Makefile.inc @@ -1,6 +1,6 @@ # 'bin' options -CFLAGS = -nostdlib -nostdinc -fno-builtin +CFLAGS = -m32 -nostdlib -nostdinc -fno-builtin INCLUDES = -I../../include diff --git a/src/bin/clock/Makefile b/src/bin/clock/Makefile index 378f5a1..5f39cbd 100644 --- a/src/bin/clock/Makefile +++ b/src/bin/clock/Makefile @@ -17,7 +17,7 @@ #Objects OBJS = main.o -LIBRARIES = ../../lib/build/libc_old.so +LIBRARIES = ../../build/libc_old.so # Link The Binary $(BINARY) : $(OBJS) diff --git a/src/bin/cp/Makefile b/src/bin/cp/Makefile index 3177e4a..db4d56e 100644 --- a/src/bin/cp/Makefile +++ b/src/bin/cp/Makefile @@ -17,7 +17,7 @@ #Objects OBJS = main.o -LIBRARIES = ../../lib/build/libc_old.so +LIBRARIES = ../../build/libc_old.so # Link The Binary $(BINARY) : $(OBJS) diff --git a/src/bin/disklabel/Makefile b/src/bin/disklabel/Makefile index e592242..a670f45 100644 --- a/src/bin/disklabel/Makefile +++ b/src/bin/disklabel/Makefile @@ -17,7 +17,7 @@ #Objects OBJS = main.o -LIBRARIES = ../../lib/build/libc_old.so +LIBRARIES = ../../build/libc_old.so # Link The Binary $(BINARY) : $(OBJS) diff --git a/src/bin/fdisk/Makefile b/src/bin/fdisk/Makefile index 705969a..18c1947 100644 --- a/src/bin/fdisk/Makefile +++ b/src/bin/fdisk/Makefile @@ -17,7 +17,7 @@ #Objects OBJS = main.o -LIBRARIES = ../../lib/build/libc_old.so +LIBRARIES = ../../build/libc_old.so # Link The Binary $(BINARY) : $(OBJS) diff --git a/src/bin/ld/Makefile b/src/bin/ld/Makefile index 5c8b38e..f2b51f1 100644 --- a/src/bin/ld/Makefile +++ b/src/bin/ld/Makefile @@ -19,7 +19,7 @@ # Link The Binary $(OUTPUT) : $(OBJS) - $(CC) -nostdlib -shared -Wl,-soname,$(OUTPUT) -e _ld -o ../../lib/build/$(OUTPUT) $(OBJS) $(LIBRARIES) $(SUBS) + $(CC) -m32 -nostdlib -shared -Wl,-soname,$(OUTPUT) -Wl,-m,elf_i386 -e _ld -o ../../build/$(OUTPUT) $(OBJS) $(LIBRARIES) $(SUBS) # strip $(OUTPUT) # Compile the source files diff --git a/src/bin/shell/Makefile b/src/bin/shell/Makefile index 5306391..69bfaa1 100644 --- a/src/bin/shell/Makefile +++ b/src/bin/shell/Makefile @@ -17,7 +17,7 @@ #Objects OBJS = main.o error.o commands.o exec.o input.o -LIBRARIES = ../../lib/build/libc_old.so ../../lib/build/ubix_api.so +LIBRARIES = ../../build/libc_old.so ../../build/ubix_api.so # Link The Binary $(BINARY) : $(OBJS) diff --git a/src/bin/shell/main.c b/src/bin/shell/main.c index fe57dca..737d3b4 100644 --- a/src/bin/shell/main.c +++ b/src/bin/shell/main.c @@ -46,7 +46,7 @@ printf("Is this My ERROR?"); - printf( "[0x%X]\n", ubix_test() ); + //MrOlsen 2017-11-17 printf( "[0x%X]\n", ubix_test() ); while ( 1 ) { aGain: printf( "%s@%s# ", machine, cwd ); diff --git a/src/bin/ubistry/Makefile b/src/bin/ubistry/Makefile index fcee79c..09701d7 100644 --- a/src/bin/ubistry/Makefile +++ b/src/bin/ubistry/Makefile @@ -17,7 +17,7 @@ #Objects OBJS = db.o message.o main.o -LIBRARIES = ../../lib/build/libc_old.so +LIBRARIES = ../../build/libc_old.so # Link The Binary $(BINARY) : $(OBJS) diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index 3390e5d..c2b1de8 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -3,9 +3,9 @@ LDFLAGS = -Bshareable #CFLAGS = -fpic -DPIC -O2 -fno-strict-aliasing -pipe -D__DBINTERFACE_PRIVATE -DPOSIX_MISTAKE -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -DYP -DHESIOD -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -CFLAGS = -fno-builtin -Wno-uninitialized -O2 -fno-strict-aliasing -pipe +CFLAGS = -m32 -fno-builtin -Wno-uninitialized -O2 -fno-strict-aliasing -pipe INCLUDES = -I../include -I../../../include -I../i386 -I../include INCLUDES = -I${INCLUDE} -CFLAGS = ${WFLAGS} -Wall -nostdlib -nostdinc -fno-builtin -fno-exceptions -O +CFLAGS = -m32 ${WFLAGS} -Wall -nostdlib -nostdinc -fno-builtin -fno-exceptions -O diff --git a/src/lib/csu/Makefile b/src/lib/csu/Makefile index a892678..d586729 100644 --- a/src/lib/csu/Makefile +++ b/src/lib/csu/Makefile @@ -5,7 +5,7 @@ include ../../Makefile.inc include ../Makefile.inc -CFLAGS = -nostdlib -nostdinc -fno-builtin -Wno-uninitialized -O2 -fno-strict-aliasing -pipe -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls #-DGCRT +CFLAGS = -m32 -nostdlib -nostdinc -fno-builtin -Wno-uninitialized -O2 -fno-strict-aliasing -pipe -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls #-DGCRT INCLUDES+= -I../libc/include # -I../../include.new diff --git a/src/lib/libc_old/Makefile b/src/lib/libc_old/Makefile index 2ed47fc..63a4ff3 100644 --- a/src/lib/libc_old/Makefile +++ b/src/lib/libc_old/Makefile @@ -26,7 +26,8 @@ (cd gen;make) # $(LD) $(LDFLAGS) -o $(OUTPUT) $(OBJS) ./stdio/*.o ./sys/*.o ./string/*.o ./stdlib/*.o # $(CC) -nostdlib -shared -Wl,-soname,libc_old.so -o ${BUILD_DIR}/$(OUTPUT) $(OBJS) $(SUBS) - $(CC) -nostdlib -ggdb -shared -Wl,-x -o ${BUILD_DIR}/$(OUTPUT).so -Wl,-soname,$(OUTPUT).so `lorder $(OBJS) $(SUBS) | tsort -q` +# tsort -q for BSD + $(CC) -m32 -nostdlib -ggdb -shared -Wl,-x -o ${BUILD_DIR}/$(OUTPUT).so -Wl,-soname,$(OUTPUT).so `lorder $(OBJS) $(SUBS) | tsort` # $(CC) -nostdlib -ggdb -static -Wl,-x -o ${BUILD_DIR}/$(OUTPUT).static.so -Wl,-soname,$(OUTPUT).static.so `lorder $(OBJS) $(SUBS) | tsort -q` # Compile the source files diff --git a/src/lib/ubix/Makefile b/src/lib/ubix/Makefile index a809034..f4ee182 100644 --- a/src/lib/ubix/Makefile +++ b/src/lib/ubix/Makefile @@ -11,7 +11,7 @@ #Objects OBJS = sstart.o #startup.o -CFLAGS = -fno-builtin -Wno-uninitialized -O2 -fno-strict-aliasing -pipe -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls +CFLAGS = -m32 -fno-builtin -Wno-uninitialized -O2 -fno-strict-aliasing -pipe -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls # Make the Binary @@ -19,19 +19,19 @@ # Compile the source files .cc.o: - $(CXX) -Wall -fomit-frame-pointer -O -I../libc/include -c -o $@ $< + $(CXX) -m32 -Wall -fomit-frame-pointer -O -I../libc/include -c -o $@ $< .cc.s: - $(CXX) -Wall -fomit-frame-pointer -O -I../libc/include -S -o $@ $< + $(CXX) -m32 -Wall -fomit-frame-pointer -O -I../libc/include -S -o $@ $< .c.o: - $(CC) -Wall -O -I../libc/include -c -o $@ $< + $(CC) -m32 -Wall -O -I../libc/include -c -o $@ $< .c.s: - $(CC) -Wall -fomit-frame-pointer -O -I../libc/include -S -o $@ $< + $(CC) -m32 -Wall -fomit-frame-pointer -O -I../libc/include -S -o $@ $< .S.o: - $(CC) -Wall -fomit-frame-pointer -c -o $@ $< + $(CC) -m32 -Wall -fomit-frame-pointer -c -o $@ $< # Clean up the junk clean: diff --git a/src/lib/ubix_api/Makefile b/src/lib/ubix_api/Makefile index 2ec692a..baa2af8 100644 --- a/src/lib/ubix_api/Makefile +++ b/src/lib/ubix_api/Makefile @@ -16,7 +16,7 @@ lib.so: $(OBJS) (cd test;make) - $(CC) -nostdlib -shared -Wl,-soname,ubix_api.so -o ${BUILD_DIR}/$(OUTPUT) $(OBJS) $(SUBS) + $(CC) -m32 -nostdlib -shared -Wl,-soname,ubix_api.so -o ${BUILD_DIR}/$(OUTPUT) $(OBJS) $(SUBS) # Compile the source files .cc.o: diff --git a/src/sys/Makefile.inc b/src/sys/Makefile.inc index f267742..9f10fa9 100644 --- a/src/sys/Makefile.inc +++ b/src/sys/Makefile.inc @@ -1,4 +1,4 @@ # $Id: Makefile.inc 113 2016-01-14 00:40:12Z reddawg $ INCLUDES = -I${INCLUDE} -CFLAGS = ${KFLAGS} -Wall -nostdlib -nostdinc -fno-builtin -fno-exceptions -ffreestanding -O +CFLAGS = ${KFLAGS} -m32 -Wall -nostdlib -nostdinc -fno-builtin -fno-exceptions -ffreestanding -O