Refactored the libmaxsi/ directory.
C and C++ files are now kept together and so are the mxmpp declarations. Header files are now stored in include/ and mxmpp'd into preproc/. All other code now -I ../libmaxsi/preproc. And other stuff to make this happen, including refactoring Makefile.
This commit is contained in:
parent
4e29f2b907
commit
fec176fa15
|
@ -23,7 +23,7 @@ LIBS=$(LIBC)
|
||||||
|
|
||||||
CPPFLAGS=$(CPUDEFINES) -U_GNU_SOURCE
|
CPPFLAGS=$(CPUDEFINES) -U_GNU_SOURCE
|
||||||
FLAGS=-nostdinc -nostdlib -fno-builtin -nostartfiles -nodefaultlibs
|
FLAGS=-nostdinc -nostdlib -fno-builtin -nostartfiles -nodefaultlibs
|
||||||
INCLUDES=-I $(LIBMAXSIROOT)/c/h/ -I $(OSROOT)/
|
INCLUDES=-I $(LIBMAXSIROOT)/preproc -I $(OSROOT)/
|
||||||
|
|
||||||
LD=ld
|
LD=ld
|
||||||
LDFLAGS=$(CPULDFLAGS)
|
LDFLAGS=$(CPULDFLAGS)
|
||||||
|
|
|
@ -5,6 +5,4 @@
|
||||||
*.so
|
*.so
|
||||||
*.a
|
*.a
|
||||||
# Ignore dynamically generated headers.
|
# Ignore dynamically generated headers.
|
||||||
/*.h
|
preproc
|
||||||
c/h/*.h
|
|
||||||
c/h/sys/*.h
|
|
||||||
|
|
|
@ -2,12 +2,13 @@ ifndef CPU
|
||||||
CPU=x86
|
CPU=x86
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
BINS=libc.a libg.a libmaxsi.a libmaxsi-sortix.a
|
||||||
|
|
||||||
ifeq ($(CPU),x86)
|
ifeq ($(CPU),x86)
|
||||||
CPUDEFINES=-DPLATFORM_X86
|
CPUDEFINES=-DPLATFORM_X86
|
||||||
CPUFLAGS=-m32
|
CPUFLAGS=-m32
|
||||||
CPULDFLAGS=-melf_i386
|
CPULDFLAGS=-melf_i386
|
||||||
CPUASFLAGS=-32
|
CPUASFLAGS=-32
|
||||||
CPUNASMFLAGS=-felf32
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CPU),x64)
|
ifeq ($(CPU),x64)
|
||||||
|
@ -16,53 +17,24 @@ ifeq ($(CPU),x64)
|
||||||
CPUFLAGS=-fPIC -m64
|
CPUFLAGS=-fPIC -m64
|
||||||
CPULDFLAGS=-melf_x86_64
|
CPULDFLAGS=-melf_x86_64
|
||||||
CPUASFLAGS=-64
|
CPUASFLAGS=-64
|
||||||
CPUNASMFLAGS=-felf64
|
|
||||||
LIBMAXSI_NO_SHARED=1 # This doesn't work yet
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DEFINES=-DLIBMAXSI_LIBRARY -DSORTIX -U_GNU_SOURCE $(CPUDEFINES)
|
CPPINCLUDES=-I preproc -I ..
|
||||||
FLAGSRELEASE=-O2
|
CPPFLAGS=-DLIBMAXSI_LIBRARY -DSORTIX -U_GNU_SOURCE $(CPUDEFINES) $(CPPINCLUDES)
|
||||||
FLAGSDEBUG=-O2
|
FLAGS=$(CPUFLAGS) -Wall -Wextra -nostdlib -fno-builtin -nostartfiles \
|
||||||
FLAGS=$(CPUFLAGS) -std=gnu++0x -Wall -Wextra -nostdlib -fno-builtin -nostartfiles -nodefaultlibs -fno-exceptions -fno-stack-protector -nostdinc $(FLAGSRELEASE) $(DEFINES)
|
-nodefaultlibs -fno-stack-protector -nostdinc
|
||||||
|
CFLAGS=$(FLAGS) -std=c99
|
||||||
|
CXXFLAGS=$(FLAGS) -std=gnu++0x -fno-exceptions -nostdinc++ -fno-rtti
|
||||||
LDFLAGS=$(CPULDFLAGS)
|
LDFLAGS=$(CPULDFLAGS)
|
||||||
ASFLAGS=$(CPUASFLAGS)
|
ASFLAGS=$(CPUASFLAGS)
|
||||||
NASMFLAGS=$(CPUNASMFLAGS)
|
|
||||||
|
|
||||||
COBJS=\
|
OBJS=\
|
||||||
c/ctype.o \
|
ctype.o \
|
||||||
c/file.o \
|
file.o \
|
||||||
c/fdio.o \
|
fdio.o \
|
||||||
c/stdio.o \
|
stdio.o \
|
||||||
c/dir.o \
|
dir.o \
|
||||||
c/fddir-sortix.o \
|
fddir-sortix.o \
|
||||||
|
|
||||||
CHEADERS=\
|
|
||||||
c/h/ctype.h \
|
|
||||||
c/h/unistd.h \
|
|
||||||
c/h/stdlib.h \
|
|
||||||
c/h/wchar.h \
|
|
||||||
c/h/stddef.h \
|
|
||||||
c/h/fcntl.h \
|
|
||||||
c/h/stdarg.h \
|
|
||||||
c/h/wctype.h \
|
|
||||||
c/h/features.h \
|
|
||||||
c/h/string.h \
|
|
||||||
c/h/errno.h \
|
|
||||||
c/h/error.h \
|
|
||||||
c/h/dirent.h \
|
|
||||||
c/h/sys/keycodes.h \
|
|
||||||
c/h/sys/termmode.h \
|
|
||||||
c/h/sys/readdirents.h \
|
|
||||||
c/h/sys/stat.h \
|
|
||||||
c/h/sys/types.h \
|
|
||||||
c/h/sys/wait.h \
|
|
||||||
c/h/stdio.h \
|
|
||||||
c/h/signal.h \
|
|
||||||
c/h/stdint.h \
|
|
||||||
|
|
||||||
COMMONOBJS=c++.o memory.o heap.o string.o error.o format.o
|
|
||||||
SORTIXOBJS:=$(addprefix sortix/,$(COMMONOBJS))
|
|
||||||
LIBMAXSIOBJS:=$(COMMONOBJS) \
|
|
||||||
sortix-sound.o \
|
sortix-sound.o \
|
||||||
process.o \
|
process.o \
|
||||||
thread.o \
|
thread.o \
|
||||||
|
@ -74,62 +46,29 @@ $(CPU)/signal.o \
|
||||||
start.o \
|
start.o \
|
||||||
time.o \
|
time.o \
|
||||||
random.o \
|
random.o \
|
||||||
integer.o
|
integer.o \
|
||||||
|
c++.o \
|
||||||
|
memory.o \
|
||||||
|
heap.o \
|
||||||
|
string.o \
|
||||||
|
error.o \
|
||||||
|
format.o \
|
||||||
|
|
||||||
MAXSIHEADERS=\
|
UNPROCHEADERDIRS:=$(shell find include -type d)
|
||||||
error.h \
|
UNPROCHEADERS:=$(shell find include -type f)
|
||||||
io.h \
|
HEADERDIRS:=$(patsubst include%,preproc%,$(UNPROCHEADERDIRS))
|
||||||
memory.h \
|
HEADERS:=$(patsubst include%,preproc%,$(UNPROCHEADERS))
|
||||||
platform.h \
|
|
||||||
string.h \
|
|
||||||
syscall.h \
|
|
||||||
thread.h \
|
|
||||||
process.h \
|
|
||||||
types.h \
|
|
||||||
format.h \
|
|
||||||
sortedlist.h \
|
|
||||||
signal.h \
|
|
||||||
signalnum.h \
|
|
||||||
sortix-vga.h \
|
|
||||||
sortix-sound.h \
|
|
||||||
|
|
||||||
OBJS:=$(LIBMAXSIOBJS)
|
SORTIXOBJS=\
|
||||||
BINS:=
|
c++.o \
|
||||||
|
memory.o \
|
||||||
|
heap.o \
|
||||||
|
string.o \
|
||||||
|
error.o \
|
||||||
|
format.o \
|
||||||
|
|
||||||
ifndef LIBMAXSI_SHARED
|
SORTIXOBJS:=$(addprefix sortix/,$(SORTIXOBJS))
|
||||||
LIBMAXSI_NO_SHARED=1
|
SORTIXCPPFLAGS:=-DSORTIX_KERNEL
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef LIBMAXSI_NO_SHARED
|
|
||||||
BINS:=$(BINS) libmaxsi.so
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef LIBMAXSI_NO_STATIC
|
|
||||||
BINS:=$(BINS) libmaxsi.a
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef LIBMAXSI_NO_SORTIX
|
|
||||||
BINS:=$(BINS) libmaxsi-sortix.a
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef LIBMAXSI_NO_LIBC
|
|
||||||
OBJS:=$(OBJS) $(COBJS)
|
|
||||||
ifndef LIBMAXSI_NO_SHARED
|
|
||||||
BINS:=$(BINS) libc.so libg.so
|
|
||||||
endif
|
|
||||||
ifndef LIBMAXSI_NO_STATIC
|
|
||||||
BINS:=$(BINS) libc.a libg.a
|
|
||||||
endif
|
|
||||||
|
|
||||||
HEADERS:=$(MAXSIHEADERS) $(CHEADERS)
|
|
||||||
|
|
||||||
else
|
|
||||||
DEFINES:=$(DEFINES) -DLIBMAXSI_NO_LIBC
|
|
||||||
endif
|
|
||||||
|
|
||||||
CFLAGS:=$(FLAGS) -std=c99 -Ic/h -I..
|
|
||||||
CXXFLAGS:=$(FLAGS) -nostdinc++ -fno-rtti -I.. -Ic/h
|
|
||||||
SORTIXFLAGS:=$(CXXFLAGS) -DSORTIX_KERNEL -I.. -I../..
|
|
||||||
|
|
||||||
all: $(BINS)
|
all: $(BINS)
|
||||||
|
|
||||||
|
@ -157,57 +96,44 @@ libg.so: libc.so
|
||||||
start.o: $(CPU)/start.o
|
start.o: $(CPU)/start.o
|
||||||
ln -sf $< $@
|
ln -sf $< $@
|
||||||
|
|
||||||
# libmaxsi
|
# header preprocessing
|
||||||
|
$(HEADERDIRS):
|
||||||
|
mkdir -p $@
|
||||||
|
|
||||||
*.cpp: $(HEADERS)
|
preproc/%: include/%
|
||||||
|
mxmpp -I decl $< -o $@
|
||||||
|
|
||||||
%.o: %.cpp
|
headers: $(HEADERDIRS) $(HEADERS)
|
||||||
g++ -c $< -o $@ $(CXXFLAGS)
|
|
||||||
|
# standard library
|
||||||
%.h: hsrc/%.h
|
%.o: %.c headers
|
||||||
echo "/* WARNING: This header is generated - edits will be lost! */" > $@
|
gcc -c $< -o $@ $(CPPFLAGS) $(CFLAGS)
|
||||||
mxmpp -I decl $< >> $@
|
|
||||||
|
%.o: %.cpp headers
|
||||||
|
g++ -c $< -o $@ $(CPPFLAGS) $(CXXFLAGS)
|
||||||
|
|
||||||
%.o: %.s
|
%.o: %.s
|
||||||
as $(ASFLAGS) $< -o $@
|
as $(ASFLAGS) $< -o $@
|
||||||
|
|
||||||
%.o: %.asm
|
|
||||||
nasm $(CPUNASMFLAGS) $< -o $@
|
|
||||||
|
|
||||||
# libc
|
|
||||||
|
|
||||||
c/*.c: $(CHEADERS)
|
|
||||||
|
|
||||||
c/%.o: c/%.c
|
|
||||||
gcc -c $< -o $@ $(CFLAGS)
|
|
||||||
|
|
||||||
c/h/%.h: c/hsrc/%.h
|
|
||||||
mkdir -p c/h
|
|
||||||
mkdir -p c/h/sys
|
|
||||||
echo "/* WARNING: This header is generated - edits will be lost! */" > $@
|
|
||||||
mxmpp -I decl -I c/decl $< >> $@
|
|
||||||
|
|
||||||
# libmaxsi-sortix
|
# libmaxsi-sortix
|
||||||
|
sortix:
|
||||||
|
mkdir -p sortix
|
||||||
|
|
||||||
sortix/*.cpp: $(HEADERS)
|
sortix/%.o: %.cpp $(HEADERS) sortix
|
||||||
|
g++ -c $< -o $@ $(CPPFLAGS) $(SORTIXCPPFLAGS) $(CXXFLAGS)
|
||||||
sortix/%.o: %.cpp $(HEADERS)
|
|
||||||
g++ -c $< -o $@ $(SORTIXFLAGS)
|
|
||||||
|
|
||||||
sortix/%.o: sortix/%.cpp
|
|
||||||
g++ -c $< -o $@ $(SORTIXFLAGS)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o sortix/*.o c/*.o x86/*.o x64/*.o *.a *.so $(CHEADERS) $(HEADERS)
|
rm -f *.o sortix/*.o c/*.o x86/*.o x64/*.o *.a *.so
|
||||||
|
rm -f $(OBJS)
|
||||||
|
rm -rf sortix $(HEADERDIRS)
|
||||||
|
|
||||||
# Installation into sysroot
|
# Installation into sysroot
|
||||||
install:
|
install:
|
||||||
mkdir -p $(SYSROOT)/usr/lib
|
mkdir -p $(SYSROOT)/usr/lib
|
||||||
for F in $(BINS); do cp -P $$F $(SYSROOT)/usr/lib || exit $?; done
|
for F in $(BINS); do cp -P $$F $(SYSROOT)/usr/lib || exit $?; done
|
||||||
|
for D in $(UNPROCHEADERDIRS); do mkdir -p $(SYSROOT)/usr/$$D || exit $?; done
|
||||||
|
for SRC in $(HEADERS); do DEST=`echo $$SRC | sed 's/preproc/include/'`; cp $$SRC $(SYSROOT)/usr/$$DEST || exit $?; done
|
||||||
mkdir -p $(SYSROOT)/usr/include
|
mkdir -p $(SYSROOT)/usr/include
|
||||||
for F in $(CHEADERS); do F=`echo $$F | sed 's/c\/h\///g'`; mkdir -p $(SYSROOT)/usr/include/`dirname $$F`; cp c/h/$$F $(SYSROOT)/usr/include/$$F || exit $?; done
|
|
||||||
mkdir -p $(SYSROOT)/usr/include/libmaxsi
|
|
||||||
for F in $(MAXSIHEADERS); do cp $$F $(SYSROOT)/usr/include/libmaxsi || exit $?; done
|
|
||||||
cp start.o $(SYSROOT)/usr/lib/crtbegin.o
|
cp start.o $(SYSROOT)/usr/lib/crtbegin.o
|
||||||
touch deleteme.cpp
|
touch deleteme.cpp
|
||||||
g++ $(CPUFLAGS) -c deleteme.cpp -o deleteme.o
|
g++ $(CPUFLAGS) -c deleteme.cpp -o deleteme.o
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
|
|
||||||
extern "C" void __cxa_pure_virtual()
|
extern "C" void __cxa_pure_virtual()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
/******************************************************************************
|
|
||||||
|
|
||||||
COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2011.
|
|
||||||
|
|
||||||
This file is part of LibMaxsi.
|
|
||||||
|
|
||||||
LibMaxsi is free software: you can redistribute it and/or modify it under
|
|
||||||
the terms of the GNU Lesser General Public License as published by the Free
|
|
||||||
Software Foundation, either version 3 of the License, or (at your option)
|
|
||||||
any later version.
|
|
||||||
|
|
||||||
LibMaxsi is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
||||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
|
||||||
more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with LibMaxsi. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
string.c
|
|
||||||
Implements things from <string.h> that is slightly incompatible with
|
|
||||||
how libmaxsi does stuff.
|
|
||||||
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
char* strdup(const char* input)
|
|
||||||
{
|
|
||||||
size_t inputsize = strlen(input);
|
|
||||||
char* result = (char*) malloc(inputsize + 1);
|
|
||||||
if ( result == NULL ) { return NULL; }
|
|
||||||
memcpy(result, input, inputsize + 1);
|
|
||||||
return result;
|
|
||||||
}
|
|
|
@ -22,10 +22,10 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "error.h"
|
#include <libmaxsi/error.h>
|
||||||
#ifndef SORTIX_KERNEL
|
#ifndef SORTIX_KERNEL
|
||||||
#include "syscall.h"
|
#include <libmaxsi/syscall.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,9 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "string.h"
|
#include <libmaxsi/string.h>
|
||||||
#include "format.h"
|
#include <libmaxsi/format.h>
|
||||||
|
|
||||||
namespace Maxsi
|
namespace Maxsi
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,9 +22,9 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "memory.h"
|
#include <libmaxsi/memory.h>
|
||||||
#include "error.h"
|
#include <libmaxsi/error.h>
|
||||||
|
|
||||||
#ifdef SORTIX_KERNEL
|
#ifdef SORTIX_KERNEL
|
||||||
#define HEAP_GROWS_DOWNWARDS
|
#define HEAP_GROWS_DOWNWARDS
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
!defined(_SVID_SOURCE) && \
|
!defined(_SVID_SOURCE) && \
|
||||||
!defined(_XOPEN_SOURCE) && !defined(_XOPEN_SOURCE_EXTENDED) && \
|
!defined(_XOPEN_SOURCE) && !defined(_XOPEN_SOURCE_EXTENDED) && \
|
||||||
!defined(_GNU_SOURCE) && \
|
!defined(_GNU_SOURCE) && \
|
||||||
true
|
1
|
||||||
#define _SORTIX_SOURCE 1
|
#define _SORTIX_SOURCE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,11 +23,11 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "signal.h"
|
#include <libmaxsi/signal.h>
|
||||||
#include "string.h"
|
#include <libmaxsi/string.h>
|
||||||
#include "io.h"
|
#include <libmaxsi/io.h>
|
||||||
#include "memory.h"
|
#include <libmaxsi/memory.h>
|
||||||
|
|
||||||
namespace Maxsi
|
namespace Maxsi
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
|
|
||||||
namespace Maxsi
|
namespace Maxsi
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,12 +22,12 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "syscall.h"
|
#include <libmaxsi/syscall.h>
|
||||||
#include "io.h"
|
#include <libmaxsi/io.h>
|
||||||
#include "format.h"
|
#include <libmaxsi/format.h>
|
||||||
#include "string.h"
|
#include <libmaxsi/string.h>
|
||||||
#include "memory.h"
|
#include <libmaxsi/memory.h>
|
||||||
#include <sys/readdirents.h>
|
#include <sys/readdirents.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "memory.h"
|
#include <libmaxsi/memory.h>
|
||||||
#include "error.h"
|
#include <libmaxsi/error.h>
|
||||||
#ifndef SORTIX_KERNEL
|
#ifndef SORTIX_KERNEL
|
||||||
#include "syscall.h"
|
#include <libmaxsi/syscall.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Maxsi
|
namespace Maxsi
|
||||||
|
|
|
@ -22,9 +22,9 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "syscall.h"
|
#include <libmaxsi/syscall.h>
|
||||||
#include "process.h"
|
#include <libmaxsi/process.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
|
|
||||||
namespace Maxsi
|
namespace Maxsi
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,12 +22,12 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "string.h"
|
#include <libmaxsi/string.h>
|
||||||
#include "memory.h"
|
#include <libmaxsi/memory.h>
|
||||||
#include "syscall.h"
|
#include <libmaxsi/syscall.h>
|
||||||
#include "process.h"
|
#include <libmaxsi/process.h>
|
||||||
#include "signal.h"
|
#include <libmaxsi/signal.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
namespace Maxsi
|
namespace Maxsi
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "syscall.h"
|
#include <libmaxsi/syscall.h>
|
||||||
#include "sortix-sound.h"
|
#include <libmaxsi/sortix-sound.h>
|
||||||
|
|
||||||
namespace System
|
namespace System
|
||||||
{
|
{
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
|
|
|
@ -22,9 +22,11 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "string.h"
|
#include <libmaxsi/string.h>
|
||||||
#include "memory.h"
|
#include <libmaxsi/memory.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
namespace Maxsi
|
namespace Maxsi
|
||||||
{
|
{
|
||||||
|
@ -224,6 +226,17 @@ namespace Maxsi
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef SORTIX_KERNEL
|
||||||
|
extern "C" char* strdup(const char* input)
|
||||||
|
{
|
||||||
|
size_t inputsize = strlen(input);
|
||||||
|
char* result = (char*) malloc(inputsize + 1);
|
||||||
|
if ( result == NULL ) { return NULL; }
|
||||||
|
memcpy(result, input, inputsize + 1);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
char* Combine(size_t NumParameters, ...)
|
char* Combine(size_t NumParameters, ...)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "syscall.h"
|
#include <libmaxsi/syscall.h>
|
||||||
#include <sys/termmode.h>
|
#include <sys/termmode.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,12 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#ifdef LIBMAXSI_LIBC
|
#ifdef LIBMAXSI_LIBC
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
#include "syscall.h"
|
#include <libmaxsi/syscall.h>
|
||||||
#include "thread.h"
|
#include <libmaxsi/thread.h>
|
||||||
|
|
||||||
#ifdef SORTIX_KERNEL
|
#ifdef SORTIX_KERNEL
|
||||||
extern "C" void PanicF(const char* Format, ...);
|
extern "C" void PanicF(const char* Format, ...);
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
|
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
#include "platform.h"
|
#include <libmaxsi/platform.h>
|
||||||
#include "string.h"
|
#include <libmaxsi/string.h>
|
||||||
#include "memory.h"
|
#include <libmaxsi/memory.h>
|
||||||
#include "syscall.h"
|
#include <libmaxsi/syscall.h>
|
||||||
|
|
||||||
namespace Maxsi
|
namespace Maxsi
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,7 +59,7 @@ else
|
||||||
endif
|
endif
|
||||||
CPPFLAGSRELEASE=-s $(O)
|
CPPFLAGSRELEASE=-s $(O)
|
||||||
CPPFLAGSDEBUG=
|
CPPFLAGSDEBUG=
|
||||||
CPPFLAGS=-I.. -I. $(CPUDEFINES) $(CPUFLAGS) -std=gnu++0x -Wall -Wextra -nostdlib -fno-builtin -nostartfiles -nodefaultlibs -fno-exceptions -fno-rtti -fno-stack-protector $(DEFINES) $(CPPFLAGSRELEASE)
|
CPPFLAGS=-I ../libmaxsi/preproc -I.. -I. $(CPUDEFINES) $(CPUFLAGS) -std=gnu++0x -Wall -Wextra -nostdlib -fno-builtin -nostartfiles -nodefaultlibs -fno-exceptions -fno-rtti -fno-stack-protector $(DEFINES) $(CPPFLAGSRELEASE)
|
||||||
OBJS=$(CPUOBJS) \
|
OBJS=$(CPUOBJS) \
|
||||||
kernel.o \
|
kernel.o \
|
||||||
descriptor_tables.o \
|
descriptor_tables.o \
|
||||||
|
|
Loading…
Reference in New Issue