refactor(rootfs): reorganize file structure and remove unnecessary .gitkeep files

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2025-03-24 15:33:07 +00:00
parent 8f88d9028e
commit d251d9d03f
55 changed files with 622 additions and 596 deletions

View File

@ -6,7 +6,7 @@
"${workspaceFolder}/libc/include/**",
"${workspaceFolder}/coreutils/include/**",
"${workspaceFolder}/libs/include/**",
"${workspaceFolder}/out/include/**"
"${workspaceFolder}/out/usr/include/**"
],
"defines": [
"__debug_vscode__",
@ -52,7 +52,7 @@
"${workspaceFolder}/libc/include/**",
"${workspaceFolder}/coreutils/include/**",
"${workspaceFolder}/libs/include/**",
"${workspaceFolder}/out/include/**"
"${workspaceFolder}/out/usr/include/**"
],
"defines": [
"__debug_vscode__",
@ -98,7 +98,7 @@
"${workspaceFolder}/libc/include/**",
"${workspaceFolder}/coreutils/include/**",
"${workspaceFolder}/libs/include/**",
"${workspaceFolder}/out/include/**"
"${workspaceFolder}/out/usr/include/**"
],
"defines": [
"__debug_vscode__",
@ -124,7 +124,7 @@
"${workspaceFolder}/libc/include/**",
"${workspaceFolder}/coreutils/include/**",
"${workspaceFolder}/libs/include/**",
"${workspaceFolder}/out/include/**"
"${workspaceFolder}/out/usr/include/**"
],
"defines": [
"__debug_vscode__",

View File

@ -13,7 +13,8 @@ export LDFLAGS := --sysroot=$(WORKSPACE_DIR)/out/ \
-ggdb3 -O0
export CFLAGS := \
--sysroot=$(WORKSPACE_DIR)/out/ \
-I$(WORKSPACE_DIR)/out/include \
-I$(WORKSPACE_DIR)/out/sys/inc \
-I$(WORKSPACE_DIR)/out/usr/include \
-DDEBUG -ggdb3 -O0 -fdiagnostics-color=always
else # DEBUG
@ -21,22 +22,22 @@ else # DEBUG
export LDFLAGS := --sysroot=$(WORKSPACE_DIR)/out/
export CFLAGS := \
--sysroot=$(WORKSPACE_DIR)/out/ \
-I$(WORKSPACE_DIR)/out/include
-I$(WORKSPACE_DIR)/out/sys/inc \
-I$(WORKSPACE_DIR)/out/usr/include
endif # DEBUG
create_out:
rm -rf out
mkdir -p out
mkdir -p out/bin
mkdir -p out/lib
mkdir -p out/include/fennix
mkdir -p out/sys/bin
mkdir -p out/sys/lib
mkdir -p out/sys/inc/fennix
mkdir -p out/usr/bin
mkdir -p out/usr/lib
mkdir -p out/usr/include
mkdir -p out/usr/share/doc
mkdir -p out/usr/share/info
mkdir -p out/usr/include
cp $(WORKSPACE_DIR)/../Kernel/include/interface/* $(WORKSPACE_DIR)/out/include/fennix/
cp $(WORKSPACE_DIR)/../Kernel/include/interface/* $(WORKSPACE_DIR)/out/sys/inc/fennix/
build_coreutils:
mkdir -p cache/coreutils
@ -44,8 +45,8 @@ build_coreutils:
cmake $(WORKSPACE_DIR)/coreutils \
-DCMAKE_INSTALL_PREFIX:PATH=$(WORKSPACE_DIR)/out \
-DCMAKE_SYSROOT=$(WORKSPACE_DIR)/out \
-DCMAKE_C_STANDARD_INCLUDE_DIRECTORIES=$(WORKSPACE_DIR)/out/include \
-DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=$(WORKSPACE_DIR)/out/include \
-DCMAKE_C_STANDARD_INCLUDE_DIRECTORIES=$(WORKSPACE_DIR)/out/sys/inc $(WORKSPACE_DIR)/out/usr/include \
-DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=$(WORKSPACE_DIR)/out/sys/inc $(WORKSPACE_DIR)/out/usr/include \
&& \
$(MAKE) -j$(shell nproc) && \
$(MAKE) install
@ -63,7 +64,7 @@ build_libc:
cmake $(WORKSPACE_DIR)/libc \
-DCMAKE_INSTALL_PREFIX:PATH=$(WORKSPACE_DIR)/out \
-DCMAKE_SYSROOT=$(WORKSPACE_DIR)/out \
-DCMAKE_C_STANDARD_INCLUDE_DIRECTORIES=$(WORKSPACE_DIR)/out/include \
-DCMAKE_C_STANDARD_INCLUDE_DIRECTORIES=$(WORKSPACE_DIR)/out/sys/inc $(WORKSPACE_DIR)/out/usr/include \
-DTARGET_OS=fennix \
-DTARGET_ARCH=$(OSARCH) \
&& \

View File

@ -11,7 +11,7 @@ FILENAME = $(notdir $(shell pwd))
WARNCFLAG = -Wall -Wextra
build: $(FILENAME).elf
cp $(FILENAME).elf $(WORKSPACE_DIR)/out/bin/$(FILENAME)
cp $(FILENAME).elf $(WORKSPACE_DIR)/out/sys/bin/$(FILENAME)
$(FILENAME).elf: $(OBJ)
$(info Linking $@)

View File

@ -65,8 +65,8 @@ int main()
signal(SIGTERM, HandleSignal);
signal(SIGINT, HandleSignal);
char *shellArgs[] = {"/bin/sh", NULL};
StartProcess("/bin/sh", shellArgs);
char *shellArgs[] = {"/sys/bin/sh", NULL};
StartProcess("/sys/bin/sh", shellArgs);
// char *dummyServiceArgs[] = {"/usr/bin/dummy_service", NULL};
// StartProcess("/usr/bin/dummy_service", dummyServiceArgs);

View File

@ -1,33 +0,0 @@
default:
$(error Do not run this Makefile directly!)
S_SOURCES = $(shell find ./ -type f -name '*.S')
C_SOURCES = $(shell find ./ -type f -name '*.c')
CXX_SOURCES = $(shell find ./ -type f -name '*.cpp')
OBJ = $(S_SOURCES:.S=.o) $(C_SOURCES:.c=.o) $(CXX_SOURCES:.cpp=.o)
FILENAME = $(notdir $(shell pwd))
WARNCFLAG = -Wall -Wextra
build: $(FILENAME).elf
cp $(FILENAME).elf $(WORKSPACE_DIR)/out/bin/$(FILENAME)
$(FILENAME).elf: $(OBJ)
$(info Linking $@)
$(CC) $(LDFLAGS) $(SYSROOT) $(OBJ) -o $@
%.o: %.c $(HEADERS)
$(info Compiling $<)
$(CC) $(CFLAGS) $(WARNCFLAG) -std=c17 -c $< -o $@
%.o: %.cpp $(HEADERS)
$(info Compiling $<)
$(CXX) $(CFLAGS) $(WARNCFLAG) -std=c++20 -fexceptions -c $< -o $@ -fno-rtti
%.o: %.S
$(info Compiling $<)
$(AS) -o $@ $<
clean:
rm -f $(OBJ) $(FILENAME).elf

View File

@ -1,114 +0,0 @@
/*
This file is part of Fennix Userspace.
Fennix Userspace is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
Fennix Userspace 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with Fennix Userspace. If not, see <https://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
#include <signal.h>
#define MAX_INPUT_SIZE 1024
#define MAX_ARG_SIZE 100
void print_prompt()
{
printf("$ ");
fflush(stdout);
}
void read_input(char *input)
{
if (fgets(input, MAX_INPUT_SIZE, stdin) == NULL)
{
perror("fgets");
exit(EXIT_FAILURE);
}
input[strcspn(input, "\n")] = '\0';
}
void parse_input(char *input, char **args)
{
int i = 0;
args[i] = strtok(input, " ");
while (args[i] != NULL)
{
i++;
args[i] = strtok(NULL, " ");
}
}
void execute_command(char **args)
{
pid_t pid = fork();
if (pid < 0)
{
perror("fork");
exit(EXIT_FAILURE);
}
else if (pid == 0)
{
if (execvp(args[0], args) < 0)
{
perror("execvp");
exit(EXIT_FAILURE);
}
}
else
{
int status;
waitpid(pid, &status, 0);
if (WIFEXITED(status))
{
printf("Child exited with status %d\n", WEXITSTATUS(status));
}
else if (WIFSIGNALED(status))
{
printf("Child terminated by signal %d\n", WTERMSIG(status));
}
}
}
void handle_signal(int sig)
{
if (sig == SIGINT)
{
printf("\nCaught signal %d (SIGINT). Type 'exit' to quit the shell.\n", sig);
print_prompt();
fflush(stdout);
}
}
int main()
{
char input[MAX_INPUT_SIZE];
char *args[MAX_ARG_SIZE];
signal(SIGINT, handle_signal);
while (1)
{
print_prompt();
read_input(input);
if (strcmp(input, "exit") == 0)
break;
parse_input(input, args);
if (args[0] != NULL)
execute_command(args);
}
return 0;
}

View File

@ -13,7 +13,7 @@ ifneq ($(shell uname -s), Linux)
endif
$(info Compiling $(FILENAME)linux)
gcc linux_glibc.c $(CFLAGS) -o $(FILENAME)linux
cp $(FILENAME)linux $(WORKSPACE_DIR)/out/bin/$(FILENAME)linux
cp $(FILENAME)linux $(WORKSPACE_DIR)/out/sys/bin/$(FILENAME)linux
$(FILENAME)win.exe:
ifneq ($(shell uname -s), Linux)
@ -22,7 +22,7 @@ ifneq ($(shell uname -s), Linux)
endif
$(info Compiling $(FILENAME)win)
x86_64-w64-mingw32-gcc win_mingw.c $(CFLAGS) -o $(FILENAME)win.exe
cp $(FILENAME)win.exe $(WORKSPACE_DIR)/out/bin/$(FILENAME)win.exe
cp $(FILENAME)win.exe $(WORKSPACE_DIR)/out/sys/bin/$(FILENAME)win.exe
build: $(FILENAME)linux $(FILENAME)win.exe

View File

@ -11,7 +11,7 @@ FILENAME = $(notdir $(shell pwd))
WARNCFLAG = -Wall -Wextra
build: $(FILENAME).elf
cp $(FILENAME).elf $(WORKSPACE_DIR)/out/bin/$(FILENAME)
cp $(FILENAME).elf $(WORKSPACE_DIR)/out/sys/bin/$(FILENAME)
# Use static linking
LDFLAGS += -ggdb3 -g -static -fno-pic -fno-pie -Wl,-static -Wl,-Ttext=0x00600000

View File

@ -11,7 +11,7 @@ FILENAME = $(notdir $(shell pwd))
WARNCFLAG = -Wall -Wextra
build: $(FILENAME).elf
cp $(FILENAME).elf $(WORKSPACE_DIR)/out/bin/$(FILENAME)
cp $(FILENAME).elf $(WORKSPACE_DIR)/out/sys/bin/$(FILENAME)
# Use static linking
LDFLAGS += -static -fno-pic -fno-pie -Wl,-static

View File

@ -344,7 +344,7 @@ void test_file()
{
printf("- Testing file operations\n");
FILE *test = fopen("/etc/passwd", "r");
FILE *test = fopen("/sys/cfg/passwd", "r");
if (test == NULL)
{
perror("fopen");
@ -353,7 +353,7 @@ void test_file()
return;
}
printf("/etc/passwd contents: ");
printf("/sys/cfg/passwd contents: ");
char ch;
while (1)
{
@ -373,7 +373,7 @@ void test_stat()
printf("- Testing stat\n");
struct stat st;
if (stat("/etc/passwd", &st) == -1)
if (stat("/sys/cfg/passwd", &st) == -1)
{
perror("stat");
fflush(stdout);
@ -385,7 +385,7 @@ void test_stat()
printf("File mode: %o\n", st.st_mode);
printf("File inode: %ld\n", st.st_ino);
int fd = open("/etc/passwd", O_RDONLY);
int fd = open("/sys/cfg/passwd", O_RDONLY);
if (fd == -1)
{
perror("open");
@ -407,7 +407,7 @@ void test_stat()
printf("File inode: %ld\n", st.st_ino);
close(fd);
if (lstat("/etc/passwd", &st) == -1)
if (lstat("/sys/cfg/passwd", &st) == -1)
{
perror("lstat");
fflush(stdout);

View File

@ -31,7 +31,7 @@ foreach(file ${SINGLE_SOURCE})
PROGRAM_NAME="${name}"
PROGRAM_VERSION="${PROJECT_VERSION}"
)
install(TARGETS ${name} DESTINATION bin)
install(TARGETS ${name} DESTINATION ${CMAKE_INSTALL_PREFIX}/sys/bin)
endforeach()
file(GLOB_RECURSE GROUP_SOURCES "src/*/*.c")
@ -47,14 +47,14 @@ foreach(name IN LISTS GROUP_MAP_)
PROGRAM_NAME="${name}"
PROGRAM_VERSION="${PROJECT_VERSION}"
)
install(TARGETS ${name} DESTINATION bin)
install(TARGETS ${name} DESTINATION ${CMAKE_INSTALL_PREFIX}/sys/bin)
endforeach()
if(UNIX AND TARGET test)
install(CODE "execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink
test
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/[\"
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/sys/bin/[\"
)")
endif()
@ -62,6 +62,6 @@ if(UNIX AND TARGET sh)
install(CODE "execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink
sh
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/fsh\"
\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/sys/bin/fsh\"
)")
endif()

View File

@ -7,8 +7,8 @@ if(NOT DEFINED ENV{WORKSPACE_DIR})
message(STATUS "Compiling standalone")
if(NOT DEFINED ENV{CMAKE_INSTALL_PREFIX})
set(CMAKE_INSTALL_PREFIX "/usr")
message(STATUS "Using default install prefix: /usr")
set(CMAKE_INSTALL_PREFIX "/")
message(STATUS "Using default install prefix: /")
else()
message(STATUS "Using custom install prefix: $ENV{CMAKE_INSTALL_PREFIX}")
endif()
@ -18,8 +18,8 @@ else()
message(STATUS "Compiling within workspace")
if(NOT DEFINED ENV{CMAKE_INSTALL_PREFIX})
set(CMAKE_INSTALL_PREFIX "$ENV{WORKSPACE_DIR}/out")
message(STATUS "Using default install prefix: $ENV{WORKSPACE_DIR}/out")
set(CMAKE_INSTALL_PREFIX "$ENV{WORKSPACE_DIR}/out/sys")
message(STATUS "Using default install prefix: $ENV{WORKSPACE_DIR}/out/sys")
else()
message(STATUS "Using custom install prefix: $ENV{CMAKE_INSTALL_PREFIX}")
endif()
@ -105,18 +105,24 @@ add_subdirectory(interpreter)
add_subdirectory(src)
add_subdirectory(libs)
if(DEFINED ENV{WORKSPACE_DIR})
set(INC_OUTPUT "inc")
else()
set(INC_OUTPUT "include")
endif()
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION include
DESTINATION ${CMAKE_INSTALL_PREFIX}/${INC_OUTPUT}
FILES_MATCHING
PATTERN "*")
install(DIRECTORY ${ABIS_GENERIC}/
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/
DESTINATION ${CMAKE_INSTALL_PREFIX}/${INC_OUTPUT}
FILES_MATCHING
PATTERN "*")
install(DIRECTORY ${ABIS_PATH}/
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/
DESTINATION ${CMAKE_INSTALL_PREFIX}/${INC_OUTPUT}
FILES_MATCHING
PATTERN "*")

View File

@ -26,7 +26,7 @@ extern "C"
#include <sys/types.h>
/**
* /etc/passwd
* /sys/cfg/passwd
* name:passwd:uid:gid:gecos:dir:shell
*
* Example

View File

@ -33,7 +33,7 @@ export struct passwd *getpwent(void)
if (pwfile == NULL)
{
pwfile = fopen("/etc/passwd", "r");
pwfile = fopen("/sys/cfg/passwd", "r"); /* FIXME: this path should be OS dependent */
if (pwfile == NULL)
return NULL;
}

View File

@ -209,7 +209,7 @@ export int gethostname(char *name, size_t namelen)
return 0;
}
int fd = open("/etc/hostname", O_RDONLY);
int fd = open("/sys/cfg/hostname", O_RDONLY); /* FIXME: this path should be OS dependent */
if (fd == -1)
return -1;

View File

@ -1,51 +1,16 @@
MAKE_TARGETS := build clean
DIRECTORIES := $(sort $(filter-out ./include/,$(dir $(wildcard ./*/))))
FFI_VERSION = 3.4.4
XML2_VERSION = 2.12.10
EXPAT_VERSION = 2.7.0
FFI_ARCHIVE = /tmp/libffi-$(FFI_VERSION).tar.gz
XML2_ARCHIVE = /tmp/libxml2-$(XML2_VERSION).tar.xz
EXPAT_ARCHIVE = /tmp/expat-$(EXPAT_VERSION).tar.gz
.PHONY: $(MAKE_TARGETS) $(DIRECTORIES) prepare
build: copy_includes $(DIRECTORIES)
clean: $(DIRECTORIES)
copy_includes:
cp -a $(CURDIR)/include/. $(WORKSPACE_DIR)/out/include
cp -a $(CURDIR)/include/. $(WORKSPACE_DIR)/out/usr/include
prepare:
rm -rf ffi/libffi-src xml2/libxml2-src expat/libexpat-src
mkdir -p ffi/libffi-src
if [ ! -f $(FFI_ARCHIVE) ]; then \
wget https://github.com/libffi/libffi/releases/download/v$(FFI_VERSION)/libffi-$(FFI_VERSION).tar.gz -O $(FFI_ARCHIVE); \
fi
cd ffi && \
tar xf $(FFI_ARCHIVE) && \
cp -r libffi-$(FFI_VERSION)/* libffi-src/ && \
rm -rf libffi-$(FFI_VERSION)
mkdir -p xml2/libxml2-src
if [ ! -f $(XML2_ARCHIVE) ]; then \
wget https://download.gnome.org/sources/libxml2/2.12/libxml2-$(XML2_VERSION).tar.xz -O $(XML2_ARCHIVE); \
fi
cd xml2 && \
tar xf $(XML2_ARCHIVE) && \
cp -r libxml2-$(XML2_VERSION)/* libxml2-src/ && \
rm -rf libxml2-$(XML2_VERSION)
mkdir -p expat/libexpat-src
if [ ! -f $(EXPAT_ARCHIVE) ]; then \
wget https://github.com/libexpat/libexpat/releases/download/R_2_7_0/expat-$(EXPAT_VERSION).tar.gz -O $(EXPAT_ARCHIVE); \
fi
cd expat && \
tar xf $(EXPAT_ARCHIVE) && \
cp -r expat-$(EXPAT_VERSION)/* libexpat-src/ && \
rm -rf expat-$(EXPAT_VERSION)
$(info Nothing to prepare)
$(DIRECTORIES):
$(MAKE) -C $@ $(MAKECMDGOALS)

View File

@ -4,7 +4,7 @@ default:
DYNAMIC_NAME := lib$(notdir $(shell pwd)).so
STATIC_NAME := lib$(notdir $(shell pwd)).a
OUTPUT_DIR=$(WORKSPACE_DIR)/out/lib/
OUTPUT_DIR=$(WORKSPACE_DIR)/out/usr/lib/
SYSROOT = --sysroot=$(WORKSPACE_DIR)/out/
S_SOURCES = $(shell find ./ -type f -name '*.S')
@ -12,7 +12,7 @@ C_SOURCES = $(shell find ./ -type f -name '*.c')
CXX_SOURCES = $(shell find ./ -type f -name '*.cpp')
OBJ = ${S_SOURCES:.S=.o} ${C_SOURCES:.c=.o} ${CXX_SOURCES:.cpp=.o}
CFLAGS := -fvisibility=hidden -fPIC -I../include -I$(WORKSPACE_DIR)/out/include -DLIBC_GIT_COMMIT='"$(shell git rev-parse HEAD)"'
CFLAGS := -fvisibility=hidden -fPIC -I../include -I$(WORKSPACE_DIR)/out/sys/inc -DLIBC_GIT_COMMIT='"$(shell git rev-parse HEAD)"'
ifeq ($(DEBUG), 1)
CFLAGS += -DDEBUG -ggdb3 -O0 -fdiagnostics-color=always

View File

@ -1 +0,0 @@
libexpat-src

View File

@ -1,29 +0,0 @@
build:
mkdir -p $(WORKSPACE_DIR)/cache/expat
if [ ! -f "$(WORKSPACE_DIR)/cache/expat/.configured" ]; then \
cd $(WORKSPACE_DIR)/cache/expat && \
$(CURDIR)/libexpat-src/configure \
--host=x86_64-none-elf \
--prefix=/usr \
--libdir=/usr/lib \
--enable-static \
--disable-shared \
--without-docbook \
--without-xmlwf \
--without-examples \
--without-tests \
CC="$(CC)" \
CXX="$(CXX)" \
AR="$(AR)" \
CFLAGS="-nostdinc -I$(WORKSPACE_DIR)/out/include" \
CXXFLAGS="-nostdinc++ -I$(WORKSPACE_DIR)/out/include" \
LDFLAGS="-nostdlib -L$(WORKSPACE_DIR)/out/lib -lc" && \
touch .configured; \
fi
$(MAKE) -C $(WORKSPACE_DIR)/cache/expat -j$(shell nproc)
$(MAKE) -C $(WORKSPACE_DIR)/cache/expat install DESTDIR=$(WORKSPACE_DIR)/out
cd $(WORKSPACE_DIR)/cache/expat && \
./libtool --finish $(WORKSPACE_DIR)/out/usr/lib
clean:
$(info Nothing to clean)

View File

@ -1 +0,0 @@
libffi-src

View File

@ -1,27 +0,0 @@
build:
mkdir -p $(WORKSPACE_DIR)/cache/ffi
if [ ! -f "$(WORKSPACE_DIR)/cache/ffi/.configured" ]; then \
cd $(WORKSPACE_DIR)/cache/ffi && \
$(CURDIR)/libffi-src/configure \
--host=x86_64-none-elf \
--prefix=/usr \
--libdir=/usr/lib \
--enable-static \
--disable-shared \
--disable-docs \
--disable-multi-os-directory \
CC="$(CC)" \
CXX="$(CXX)" \
AR="$(AR)" \
CFLAGS="-nostdinc -I$(WORKSPACE_DIR)/out/include" \
CXXFLAGS="-nostdinc++ -I$(WORKSPACE_DIR)/out/include" \
LDFLAGS="-nostdlib -L$(WORKSPACE_DIR)/out/lib -lc" && \
touch .configured; \
fi
$(MAKE) -C $(WORKSPACE_DIR)/cache/ffi -j$(shell nproc)
$(MAKE) -C $(WORKSPACE_DIR)/cache/ffi install DESTDIR=$(WORKSPACE_DIR)/out
cd $(WORKSPACE_DIR)/cache/ffi && \
./libtool --finish $(WORKSPACE_DIR)/out/usr/lib
clean:
$(info Nothing to clean)

View File

@ -1,6 +1,6 @@
NAME=gcc
OBJECT_NAME=lib$(NAME).a
OUTPUT_DIR=$(WORKSPACE_DIR)/out/lib/
OUTPUT_DIR=$(WORKSPACE_DIR)/out/sys/lib/
CRTBEGIN_PATH = $(shell $(CC) -print-file-name=libgcc.a)
build: $(OBJECT_NAME)

View File

@ -1,2 +0,0 @@
libxml2-src

View File

@ -1,47 +0,0 @@
build:
mkdir -p $(WORKSPACE_DIR)/cache/xml2
if [ ! -f "$(WORKSPACE_DIR)/cache/xml2/.configured" ]; then \
cd $(WORKSPACE_DIR)/cache/xml2 && \
$(CURDIR)/libxml2-src/configure \
--host=x86_64-none-elf \
--prefix=/usr \
--libdir=/usr/lib \
--enable-static \
--disable-shared \
--without-python \
--without-debug \
--without-docbook \
--without-ftp \
--without-http \
--without-html \
--without-legacy \
--without-pattern \
--without-push \
--without-regexps \
--without-sax1 \
--without-schemas \
--without-schematron \
--without-threads \
--without-valid \
--without-xinclude \
--without-xpath \
--without-xptr \
--without-modules \
--without-zlib \
--without-lzma \
--without-coverage \
CC="$(CC)" \
CXX="$(CXX)" \
AR="$(AR)" \
CFLAGS="-nostdinc -I$(WORKSPACE_DIR)/out/include" \
CXXFLAGS="-nostdinc++ -I$(WORKSPACE_DIR)/out/include" \
LDFLAGS="-nostdlib -L$(WORKSPACE_DIR)/out/lib -lc" && \
touch .configured; \
fi
$(MAKE) -C $(WORKSPACE_DIR)/cache/xml2 -j$(shell nproc)
$(MAKE) -C $(WORKSPACE_DIR)/cache/xml2 install DESTDIR=$(WORKSPACE_DIR)/out
cd $(WORKSPACE_DIR)/cache/xml2 && \
./libtool --finish $(WORKSPACE_DIR)/out/usr/lib
clean:
$(info Nothing to clean)