aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile14
-rw-r--r--apps/Makefile2
-rw-r--r--apps/window.c2
-rw-r--r--apps/wm.c10
-rw-r--r--kernel/Makefile2
-rw-r--r--libgui/Makefile25
-rw-r--r--libnet/Makefile20
-rw-r--r--libs/libc/Makefile (renamed from libc/Makefile)18
-rw-r--r--libs/libc/alloc.c (renamed from libc/alloc.c)0
-rw-r--r--libs/libc/conv.c (renamed from libc/conv.c)0
-rw-r--r--libs/libc/cpu.c (renamed from libc/cpu.c)0
-rw-r--r--libs/libc/crt/crt0.asm (renamed from libc/crt/crt0.asm)0
-rw-r--r--libs/libc/crypto.c (renamed from libc/crypto.c)0
-rw-r--r--libs/libc/errno.c (renamed from libc/errno.c)0
-rw-r--r--libs/libc/inc/arg.h (renamed from libc/inc/arg.h)0
-rw-r--r--libs/libc/inc/assert.h (renamed from libc/inc/assert.h)0
-rw-r--r--libs/libc/inc/conv.h (renamed from libc/inc/conv.h)0
-rw-r--r--libs/libc/inc/cpu.h (renamed from libc/inc/cpu.h)0
-rw-r--r--libs/libc/inc/crypto.h (renamed from libc/inc/crypto.h)0
-rw-r--r--libs/libc/inc/def.h (renamed from libc/inc/def.h)0
-rw-r--r--libs/libc/inc/errno.h (renamed from libc/inc/errno.h)0
-rw-r--r--libs/libc/inc/input.h (renamed from libc/inc/input.h)0
-rw-r--r--libs/libc/inc/ioctl.h (renamed from libc/inc/ioctl.h)0
-rw-r--r--libs/libc/inc/list.h (renamed from libc/inc/list.h)0
-rw-r--r--libs/libc/inc/math.h (renamed from libc/inc/math.h)0
-rw-r--r--libs/libc/inc/mem.h (renamed from libc/inc/mem.h)0
-rw-r--r--libs/libc/inc/print.h (renamed from libc/inc/print.h)0
-rw-r--r--libs/libc/inc/random.h (renamed from libc/inc/random.h)0
-rw-r--r--libs/libc/inc/socket.h (renamed from libc/inc/socket.h)0
-rw-r--r--libs/libc/inc/stack.h (renamed from libc/inc/stack.h)0
-rw-r--r--libs/libc/inc/str.h (renamed from libc/inc/str.h)0
-rw-r--r--libs/libc/inc/sys.h (renamed from libc/inc/sys.h)0
-rw-r--r--libs/libc/inc/vec.h (renamed from libc/inc/vec.h)0
-rw-r--r--libs/libc/list.c (renamed from libc/list.c)0
-rw-r--r--libs/libc/math.c (renamed from libc/math.c)0
-rw-r--r--libs/libc/mem.c (renamed from libc/mem.c)0
-rw-r--r--libs/libc/print.c (renamed from libc/print.c)0
-rw-r--r--libs/libc/random.c (renamed from libc/random.c)0
-rw-r--r--libs/libc/sanitize.c (renamed from libc/sanitize.c)0
-rw-r--r--libs/libc/stack.c (renamed from libc/stack.c)0
-rw-r--r--libs/libc/str.c (renamed from libc/str.c)0
-rw-r--r--libs/libc/sys.c (renamed from libc/sys.c)0
-rw-r--r--libs/libgui/Makefile25
-rw-r--r--libs/libgui/bmp.c (renamed from libgui/bmp.c)2
-rw-r--r--libs/libgui/bmp.h (renamed from libgui/inc/bmp.h)0
-rw-r--r--libs/libgui/gfx.c (renamed from libgui/gfx.c)12
-rw-r--r--libs/libgui/gfx.h (renamed from libgui/inc/gfx.h)2
-rw-r--r--libs/libgui/gui.c (renamed from libgui/gui.c)4
-rw-r--r--libs/libgui/gui.h (renamed from libgui/inc/gui.h)0
-rw-r--r--libs/libgui/msg.c (renamed from libgui/msg.c)2
-rw-r--r--libs/libgui/msg.h (renamed from libgui/inc/msg.h)2
-rw-r--r--libs/libgui/png.c (renamed from libgui/png.c)2
-rw-r--r--libs/libgui/png.h (renamed from libgui/inc/png.h)0
-rw-r--r--libs/libgui/psf.c (renamed from libgui/psf.c)4
-rw-r--r--libs/libgui/psf.h (renamed from libgui/inc/psf.h)0
-rw-r--r--libs/libgui/vesa.h (renamed from libgui/inc/vesa.h)0
-rw-r--r--libs/libnet/Makefile20
-rw-r--r--libs/libnet/dns.c (renamed from libnet/dns.c)4
-rw-r--r--libs/libnet/dns.h (renamed from libnet/inc/dns.h)0
-rw-r--r--libs/libnet/http.c (renamed from libnet/http.c)6
-rw-r--r--libs/libnet/http.h (renamed from libnet/inc/http.h)2
-rw-r--r--libs/libnet/ip.c (renamed from libnet/ip.c)2
-rw-r--r--libs/libnet/ip.h (renamed from libnet/inc/ip.h)0
-rw-r--r--libs/libnet/net.h (renamed from libnet/inc/net.h)6
-rw-r--r--libs/libtxt/Makefile20
-rw-r--r--libs/libtxt/html.c (renamed from libtxt/html.c)6
-rw-r--r--libs/libtxt/html.h (renamed from libtxt/inc/html.h)0
-rw-r--r--libs/libtxt/keymap.c (renamed from libtxt/keymap.c)2
-rw-r--r--libs/libtxt/keymap.h (renamed from libtxt/inc/keymap.h)0
-rw-r--r--libs/libtxt/xml.c (renamed from libtxt/xml.c)2
-rw-r--r--libs/libtxt/xml.h (renamed from libtxt/inc/xml.h)0
-rw-r--r--libtxt/Makefile20
-rwxr-xr-xrun6
73 files changed, 122 insertions, 122 deletions
diff --git a/Makefile b/Makefile
index e086c05..30dd819 100644
--- a/Makefile
+++ b/Makefile
@@ -14,15 +14,15 @@ debug: compile
export
compile:
- @$(MAKE) clean --no-print-directory -C libc/
- @$(MAKE) libc --no-print-directory -C libc/
+ @$(MAKE) clean --no-print-directory -C libs/libc/
+ @$(MAKE) libc --no-print-directory -C libs/libc/
@echo "Compiled libc"
- @$(MAKE) clean --no-print-directory -C libc/
- @$(MAKE) libk --no-print-directory -C libc/
+ @$(MAKE) clean --no-print-directory -C libs/libc/
+ @$(MAKE) libk --no-print-directory -C libs/libc/
@echo "Compiled libk"
- @$(MAKE) --no-print-directory -C libgui/
+ @$(MAKE) --no-print-directory -C libs/libgui/
@echo "Compiled libgui"
- @$(MAKE) --no-print-directory -C libtxt/
+ @$(MAKE) --no-print-directory -C libs/libtxt/
@echo "Compiled libtxt"
@$(MAKE) --no-print-directory -C kernel/
@echo "Compiled kernel"
@@ -32,4 +32,4 @@ compile:
@echo "Compiled apps"
clean:
- @find kernel/ apps/ libc/ libtxt/ libgui/ libnet/ boot/ \( -name "*.o" -or -name "*.a" -or -name "*.elf" -or -name "*.bin" \) -type f -delete
+ @find kernel/ apps/ libs/ boot/ \( -name "*.o" -or -name "*.a" -or -name "*.elf" -or -name "*.bin" \) -type f -delete
diff --git a/apps/Makefile b/apps/Makefile
index d43104a..f2ab790 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -6,7 +6,7 @@ LD = ccache ../cross/opt/bin/i686-elf-ld
OC = ccache ../cross/opt/bin/i686-elf-objcopy
ST = ccache ../cross/opt/bin/i686-elf-strip
-CFLAGS = $(CFLAGS_DEFAULT) -I../libc/inc/ -I../libgui/inc/ -I../libtxt/inc/ -Duserspace
+CFLAGS = $(CFLAGS_DEFAULT) -I../libs/ -I../libs/libc/inc/ -Duserspace
all: $(COBJS)
diff --git a/apps/window.c b/apps/window.c
index 08c4263..4dbf9dc 100644
--- a/apps/window.c
+++ b/apps/window.c
@@ -1,7 +1,7 @@
// MIT License, Copyright (c) 2021 Marvin Borner
#include <assert.h>
-#include <gui.h>
+#include <libgui/gui.h>
#include <print.h>
int main(void)
diff --git a/apps/wm.c b/apps/wm.c
index f43a3f0..e522fc2 100644
--- a/apps/wm.c
+++ b/apps/wm.c
@@ -3,15 +3,15 @@
#include <assert.h>
#include <def.h>
#include <errno.h>
-#include <gfx.h>
-#include <gui.h>
#include <input.h>
#include <ioctl.h>
-#include <keymap.h>
+#include <libgui/gfx.h>
+#include <libgui/gui.h>
+#include <libgui/msg.h>
+#include <libgui/vesa.h>
+#include <libtxt/keymap.h>
#include <list.h>
-#include <msg.h>
#include <random.h>
-#include <vesa.h>
//#define FLUSH_TIMEOUT 6
diff --git a/kernel/Makefile b/kernel/Makefile
index 64035e5..e9c7b09 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -23,7 +23,7 @@ LD = ccache ../cross/opt/bin/i686-elf-ld
OC = ccache ../cross/opt/bin/i686-elf-objcopy
AS = ccache nasm
-CFLAGS = $(CFLAGS_DEFAULT) -Wno-address-of-packed-member -ffreestanding -Wl,-ekernel_main -I../libc/inc/ -Iinc/ -Dkernel
+CFLAGS = $(CFLAGS_DEFAULT) -Wno-address-of-packed-member -ffreestanding -Wl,-ekernel_main -I../libs/libc/inc/ -Iinc/ -Dkernel
ASFLAGS = -f elf32
all: compile
diff --git a/libgui/Makefile b/libgui/Makefile
deleted file mode 100644
index 166a3c0..0000000
--- a/libgui/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# MIT License, Copyright (c) 2020 Marvin Borner
-
-COBJS = psf.o \
- bmp.o \
- png.o \
- gfx.o \
- gui.o \
- msg.o
-CC = ccache ../cross/opt/bin/i686-elf-gcc
-LD = ccache ../cross/opt/bin/i686-elf-ld
-AR = ccache ../cross/opt/bin/i686-elf-ar
-
-CFLAGS = $(CFLAGS_DEFAULT) -Iinc/ -I../libc/inc/ -fPIE -Duserspace
-
-all: libgui
-
-%.o: %.c
- @$(CC) -c $(CFLAGS) $< -o $@
-
-libgui: $(COBJS)
- @mkdir -p ../build/
- @$(AR) rcs ../build/libgui.a $+
-
-clean:
- @find . -name "*.o" -type f -delete
diff --git a/libnet/Makefile b/libnet/Makefile
deleted file mode 100644
index 37dad87..0000000
--- a/libnet/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# MIT License, Copyright (c) 2020 Marvin Borner
-
-COBJS = dns.o http.o ip.o
-CC = ccache ../cross/opt/bin/i686-elf-gcc
-LD = ccache ../cross/opt/bin/i686-elf-ld
-AR = ccache ../cross/opt/bin/i686-elf-ar
-
-CFLAGS = $(CFLAGS_DEFAULT) -Iinc/ -I../libc/inc/ -fPIE -Duserspace
-
-all: libtxt
-
-%.o: %.c
- @$(CC) -c $(CFLAGS) $< -o $@
-
-libtxt: $(COBJS)
- @mkdir -p ../build/
- @$(AR) rcs ../build/libnet.a $+
-
-clean:
- @find . -name "*.o" -type f -delete
diff --git a/libc/Makefile b/libs/libc/Makefile
index 9ebf838..1c66f43 100644
--- a/libc/Makefile
+++ b/libs/libc/Makefile
@@ -15,9 +15,9 @@ COBJS = sanitize.o \
list.o \
stack.o \
random.o
-CC = ccache ../cross/opt/bin/i686-elf-gcc
-LD = ccache ../cross/opt/bin/i686-elf-ld
-AR = ccache ../cross/opt/bin/i686-elf-ar
+CC = ccache ../../cross/opt/bin/i686-elf-gcc
+LD = ccache ../../cross/opt/bin/i686-elf-ld
+AR = ccache ../../cross/opt/bin/i686-elf-ar
AS = ccache nasm
CFLAGS = $(CFLAGS_DEFAULT) -Iinc/
@@ -27,16 +27,16 @@ ASFLAGS = -f elf32
%.o: %.c
@$(CC) -c $(CFLAGS) $< -o $@
-libc: CFLAGS += -Duserspace -fPIE
+libc: CFLAGS += -Duserspace
libc: $(COBJS)
@$(AS) $(ASFLAGS) crt/crt0.asm -o crt0.o
- @mkdir -p ../build/
- @$(AR) rcs ../build/libc.a crt0.o $+
+ @mkdir -p ../../build/
+ @$(AR) rcs ../../build/libc.a crt0.o $+
-libk: CFLAGS += -Dkernel -ffreestanding -I../kernel/inc/ $(CFLAGS_EXTRA)
+libk: CFLAGS += -Dkernel -ffreestanding -I../../kernel/inc/ $(CFLAGS_EXTRA)
libk: $(COBJS)
- @mkdir -p ../build/
- @$(AR) rcs ../build/libk.a $+
+ @mkdir -p ../../build/
+ @$(AR) rcs ../../build/libk.a $+
clean:
@find . -name "*.o" -type f -delete
diff --git a/libc/alloc.c b/libs/libc/alloc.c
index b8139d0..b8139d0 100644
--- a/libc/alloc.c
+++ b/libs/libc/alloc.c
diff --git a/libc/conv.c b/libs/libc/conv.c
index 670fdb3..670fdb3 100644
--- a/libc/conv.c
+++ b/libs/libc/conv.c
diff --git a/libc/cpu.c b/libs/libc/cpu.c
index 8ca4d27..8ca4d27 100644
--- a/libc/cpu.c
+++ b/libs/libc/cpu.c
diff --git a/libc/crt/crt0.asm b/libs/libc/crt/crt0.asm
index e002952..e002952 100644
--- a/libc/crt/crt0.asm
+++ b/libs/libc/crt/crt0.asm
diff --git a/libc/crypto.c b/libs/libc/crypto.c
index 310931d..310931d 100644
--- a/libc/crypto.c
+++ b/libs/libc/crypto.c
diff --git a/libc/errno.c b/libs/libc/errno.c
index 7204f5b..7204f5b 100644
--- a/libc/errno.c
+++ b/libs/libc/errno.c
diff --git a/libc/inc/arg.h b/libs/libc/inc/arg.h
index 73e592d..73e592d 100644
--- a/libc/inc/arg.h
+++ b/libs/libc/inc/arg.h
diff --git a/libc/inc/assert.h b/libs/libc/inc/assert.h
index 3656c33..3656c33 100644
--- a/libc/inc/assert.h
+++ b/libs/libc/inc/assert.h
diff --git a/libc/inc/conv.h b/libs/libc/inc/conv.h
index adf9003..adf9003 100644
--- a/libc/inc/conv.h
+++ b/libs/libc/inc/conv.h
diff --git a/libc/inc/cpu.h b/libs/libc/inc/cpu.h
index d709d86..d709d86 100644
--- a/libc/inc/cpu.h
+++ b/libs/libc/inc/cpu.h
diff --git a/libc/inc/crypto.h b/libs/libc/inc/crypto.h
index bbe8d7e..bbe8d7e 100644
--- a/libc/inc/crypto.h
+++ b/libs/libc/inc/crypto.h
diff --git a/libc/inc/def.h b/libs/libc/inc/def.h
index 708ffee..708ffee 100644
--- a/libc/inc/def.h
+++ b/libs/libc/inc/def.h
diff --git a/libc/inc/errno.h b/libs/libc/inc/errno.h
index e226aba..e226aba 100644
--- a/libc/inc/errno.h
+++ b/libs/libc/inc/errno.h
diff --git a/libc/inc/input.h b/libs/libc/inc/input.h
index 5fc7ed1..5fc7ed1 100644
--- a/libc/inc/input.h
+++ b/libs/libc/inc/input.h
diff --git a/libc/inc/ioctl.h b/libs/libc/inc/ioctl.h
index c3eec56..c3eec56 100644
--- a/libc/inc/ioctl.h
+++ b/libs/libc/inc/ioctl.h
diff --git a/libc/inc/list.h b/libs/libc/inc/list.h
index 0b82b48..0b82b48 100644
--- a/libc/inc/list.h
+++ b/libs/libc/inc/list.h
diff --git a/libc/inc/math.h b/libs/libc/inc/math.h
index 82f431f..82f431f 100644
--- a/libc/inc/math.h
+++ b/libs/libc/inc/math.h
diff --git a/libc/inc/mem.h b/libs/libc/inc/mem.h
index ec00628..ec00628 100644
--- a/libc/inc/mem.h
+++ b/libs/libc/inc/mem.h
diff --git a/libc/inc/print.h b/libs/libc/inc/print.h
index 58b5dc6..58b5dc6 100644
--- a/libc/inc/print.h
+++ b/libs/libc/inc/print.h
diff --git a/libc/inc/random.h b/libs/libc/inc/random.h
index a82524c..a82524c 100644
--- a/libc/inc/random.h
+++ b/libs/libc/inc/random.h
diff --git a/libc/inc/socket.h b/libs/libc/inc/socket.h
index 18bc316..18bc316 100644
--- a/libc/inc/socket.h
+++ b/libs/libc/inc/socket.h
diff --git a/libc/inc/stack.h b/libs/libc/inc/stack.h
index f5ad52b..f5ad52b 100644
--- a/libc/inc/stack.h
+++ b/libs/libc/inc/stack.h
diff --git a/libc/inc/str.h b/libs/libc/inc/str.h
index d0a521f..d0a521f 100644
--- a/libc/inc/str.h
+++ b/libs/libc/inc/str.h
diff --git a/libc/inc/sys.h b/libs/libc/inc/sys.h
index 19fb3ee..19fb3ee 100644
--- a/libc/inc/sys.h
+++ b/libs/libc/inc/sys.h
diff --git a/libc/inc/vec.h b/libs/libc/inc/vec.h
index a036931..a036931 100644
--- a/libc/inc/vec.h
+++ b/libs/libc/inc/vec.h
diff --git a/libc/list.c b/libs/libc/list.c
index c86b23d..c86b23d 100644
--- a/libc/list.c
+++ b/libs/libc/list.c
diff --git a/libc/math.c b/libs/libc/math.c
index c8142b5..c8142b5 100644
--- a/libc/math.c
+++ b/libs/libc/math.c
diff --git a/libc/mem.c b/libs/libc/mem.c
index 95242e4..95242e4 100644
--- a/libc/mem.c
+++ b/libs/libc/mem.c
diff --git a/libc/print.c b/libs/libc/print.c
index 2422fed..2422fed 100644
--- a/libc/print.c
+++ b/libs/libc/print.c
diff --git a/libc/random.c b/libs/libc/random.c
index 2801029..2801029 100644
--- a/libc/random.c
+++ b/libs/libc/random.c
diff --git a/libc/sanitize.c b/libs/libc/sanitize.c
index 02eef84..02eef84 100644
--- a/libc/sanitize.c
+++ b/libs/libc/sanitize.c
diff --git a/libc/stack.c b/libs/libc/stack.c
index 0cbb69d..0cbb69d 100644
--- a/libc/stack.c
+++ b/libs/libc/stack.c
diff --git a/libc/str.c b/libs/libc/str.c
index ba16920..ba16920 100644
--- a/libc/str.c
+++ b/libs/libc/str.c
diff --git a/libc/sys.c b/libs/libc/sys.c
index 491c37c..491c37c 100644
--- a/libc/sys.c
+++ b/libs/libc/sys.c
diff --git a/libs/libgui/Makefile b/libs/libgui/Makefile
new file mode 100644
index 0000000..3e2b0b2
--- /dev/null
+++ b/libs/libgui/Makefile
@@ -0,0 +1,25 @@
+# MIT License, Copyright (c) 2020 Marvin Borner
+
+COBJS = psf.o \
+ bmp.o \
+ png.o \
+ gfx.o \
+ gui.o \
+ msg.o
+CC = ccache ../../cross/opt/bin/i686-elf-gcc
+LD = ccache ../../cross/opt/bin/i686-elf-ld
+AR = ccache ../../cross/opt/bin/i686-elf-ar
+
+CFLAGS = $(CFLAGS_DEFAULT) -I../ -I../libc/inc/ -Duserspace
+
+all: libgui
+
+%.o: %.c
+ @$(CC) -c $(CFLAGS) $< -o $@
+
+libgui: $(COBJS)
+ @mkdir -p ../../build/
+ @$(AR) rcs ../../build/libgui.a $+
+
+clean:
+ @find . -name "*.o" -type f -delete
diff --git a/libgui/bmp.c b/libs/libgui/bmp.c
index c8795e8..5576d16 100644
--- a/libgui/bmp.c
+++ b/libs/libgui/bmp.c
@@ -1,7 +1,7 @@
// MIT License, Copyright (c) 2020 Marvin Borner
-#include <bmp.h>
#include <def.h>
+#include <libgui/bmp.h>
#include <mem.h>
#include <print.h>
#include <sys.h>
diff --git a/libgui/inc/bmp.h b/libs/libgui/bmp.h
index ff8360b..ff8360b 100644
--- a/libgui/inc/bmp.h
+++ b/libs/libgui/bmp.h
diff --git a/libgui/gfx.c b/libs/libgui/gfx.c
index ff5bf69..259b03f 100644
--- a/libgui/gfx.c
+++ b/libs/libgui/gfx.c
@@ -4,15 +4,15 @@
// TODO: Use efficient redrawing
#include <assert.h>
-#include <bmp.h>
-#include <gfx.h>
+#include <libgui/bmp.h>
+#include <libgui/gfx.h>
+#include <libgui/msg.h>
+#include <libgui/png.h>
+#include <libgui/psf.h>
+#include <libgui/vesa.h>
#include <mem.h>
-#include <msg.h>
-#include <png.h>
-#include <psf.h>
#include <str.h>
#include <sys.h>
-#include <vesa.h>
// TODO: Move to some global config file
#define FONT_COUNT 6
diff --git a/libgui/inc/gfx.h b/libs/libgui/gfx.h
index f3555a4..8ac01d0 100644
--- a/libgui/inc/gfx.h
+++ b/libs/libgui/gfx.h
@@ -5,9 +5,9 @@
#define GFX_H
#include <def.h>
+#include <libgui/vesa.h>
#include <sys.h>
#include <vec.h>
-#include <vesa.h>
#define WM_PATH "/bin/wm"
diff --git a/libgui/gui.c b/libs/libgui/gui.c
index 87ea4c9..d8435e6 100644
--- a/libgui/gui.c
+++ b/libs/libgui/gui.c
@@ -3,9 +3,9 @@
#include <assert.h>
#include <def.h>
#include <errno.h>
-#include <gui.h>
+#include <libgui/gui.h>
+#include <libgui/msg.h>
#include <list.h>
-#include <msg.h>
#include <print.h>
#define WM_PATH "/bin/wm"
diff --git a/libgui/inc/gui.h b/libs/libgui/gui.h
index a3f74f8..a3f74f8 100644
--- a/libgui/inc/gui.h
+++ b/libs/libgui/gui.h
diff --git a/libgui/msg.c b/libs/libgui/msg.c
index 5f4ae39..73af242 100644
--- a/libgui/msg.c
+++ b/libs/libgui/msg.c
@@ -2,7 +2,7 @@
#include <assert.h>
#include <errno.h>
-#include <msg.h>
+#include <libgui/msg.h>
#include <print.h>
#include <sys.h>
diff --git a/libgui/inc/msg.h b/libs/libgui/msg.h
index 0e85d5a..7326135 100644
--- a/libgui/inc/msg.h
+++ b/libs/libgui/msg.h
@@ -4,7 +4,7 @@
#define MSG_H
#include <def.h>
-#include <gfx.h>
+#include <libgui/gfx.h>
#define MSG_PING_SEND 0x07734
#define MSG_PING_RECV 0x7474
diff --git a/libgui/png.c b/libs/libgui/png.c
index 5f55a3e..6f8f4b5 100644
--- a/libgui/png.c
+++ b/libs/libgui/png.c
@@ -30,8 +30,8 @@ Rename this file to png.cpp to use it for C++, or to png.c to use it for C.
*/
#include <def.h>
+#include <libgui/png.h>
#include <mem.h>
-#include <png.h>
#include <sys.h>
#if defined(_MSC_VER) && \
diff --git a/libgui/inc/png.h b/libs/libgui/png.h
index dba0947..dba0947 100644
--- a/libgui/inc/png.h
+++ b/libs/libgui/png.h
diff --git a/libgui/psf.c b/libs/libgui/psf.c
index e590add..e28c2d7 100644
--- a/libgui/psf.c
+++ b/libs/libgui/psf.c
@@ -2,10 +2,10 @@
// PSF parser
#include <def.h>
-#include <gfx.h>
+#include <libgui/gfx.h>
+#include <libgui/psf.h>
#include <mem.h>
#include <print.h>
-#include <psf.h>
// Verifies the PSF magics
// Returns the PSF version or 0
diff --git a/libgui/inc/psf.h b/libs/libgui/psf.h
index 63a3d1e..63a3d1e 100644
--- a/libgui/inc/psf.h
+++ b/libs/libgui/psf.h
diff --git a/libgui/inc/vesa.h b/libs/libgui/vesa.h
index 892bd89..892bd89 100644
--- a/libgui/inc/vesa.h
+++ b/libs/libgui/vesa.h
diff --git a/libs/libnet/Makefile b/libs/libnet/Makefile
new file mode 100644
index 0000000..85c8fab
--- /dev/null
+++ b/libs/libnet/Makefile
@@ -0,0 +1,20 @@
+# MIT License, Copyright (c) 2020 Marvin Borner
+
+COBJS = dns.o http.o ip.o
+CC = ccache ../../cross/opt/bin/i686-elf-gcc
+LD = ccache ../../cross/opt/bin/i686-elf-ld
+AR = ccache ../../cross/opt/bin/i686-elf-ar
+
+CFLAGS = $(CFLAGS_DEFAULT) -I../ -I../libc/inc/ -Duserspace
+
+all: libtxt
+
+%.o: %.c
+ @$(CC) -c $(CFLAGS) $< -o $@
+
+libtxt: $(COBJS)
+ @mkdir -p ../../build/
+ @$(AR) rcs ../../build/libnet.a $+
+
+clean:
+ @find . -name "*.o" -type f -delete
diff --git a/libnet/dns.c b/libs/libnet/dns.c
index 6b59ac9..f20f33a 100644
--- a/libnet/dns.c
+++ b/libs/libnet/dns.c
@@ -3,11 +3,11 @@
// TODO: DNS cache
#include <def.h>
+#include <libnet/net.h>
+#include <libnet/socket.h>
#include <mem.h>
-#include <net.h>
#include <print.h>
#include <random.h>
-#include <socket.h>
#include <str.h>
static u32 dns_ip_addr = ip(1, 1, 1, 1);
diff --git a/libnet/inc/dns.h b/libs/libnet/dns.h
index d6673e6..d6673e6 100644
--- a/libnet/inc/dns.h
+++ b/libs/libnet/dns.h
diff --git a/libnet/http.c b/libs/libnet/http.c
index 2910ad3..808d4c2 100644
--- a/libnet/http.c
+++ b/libs/libnet/http.c
@@ -3,11 +3,11 @@
#include <assert.h>
#include <conv.h>
#include <def.h>
-#include <http.h>
+#include <libnet/http.h>
+#include <libnet/net.h>
+#include <libnet/socket.h>
#include <mem.h>
-#include <net.h>
#include <print.h>
-#include <socket.h>
#include <str.h>
char *http_data(char *r)
diff --git a/libnet/inc/http.h b/libs/libnet/http.h
index 45709c6..b9160ad 100644
--- a/libnet/inc/http.h
+++ b/libs/libnet/http.h
@@ -4,7 +4,7 @@
#define HTTP_H
#include <def.h>
-#include <socket.h>
+#include <libnet/socket.h>
char *http_data(char *response);
char *http_header_key(char *r, const char *key);
diff --git a/libnet/ip.c b/libs/libnet/ip.c
index eb2e202..20e1a38 100644
--- a/libnet/ip.c
+++ b/libs/libnet/ip.c
@@ -3,8 +3,8 @@
// This is a userspace wrapper for some things
#include <def.h>
+#include <libnet/net.h>
#include <mem.h>
-#include <net.h>
#include <str.h>
// Inspired by Paul Vixie, 1996
diff --git a/libnet/inc/ip.h b/libs/libnet/ip.h
index e06aba2..e06aba2 100644
--- a/libnet/inc/ip.h
+++ b/libs/libnet/ip.h
diff --git a/libnet/inc/net.h b/libs/libnet/net.h
index e5190c7..4bfda2b 100644
--- a/libnet/inc/net.h
+++ b/libs/libnet/net.h
@@ -3,10 +3,10 @@
#ifndef NET_H
#define NET_H
-#include <dns.h>
-#include <ip.h>
+#include <libnet/dns.h>
+#include <libnet/ip.h>
+#include <libnet/socket.h>
#include <print.h>
-#include <socket.h>
#include <sys.h>
#define htonl(l) \
diff --git a/libs/libtxt/Makefile b/libs/libtxt/Makefile
new file mode 100644
index 0000000..93a7993
--- /dev/null
+++ b/libs/libtxt/Makefile
@@ -0,0 +1,20 @@
+# MIT License, Copyright (c) 2020 Marvin Borner
+
+COBJS = keymap.o #xml.o html.o
+CC = ccache ../../cross/opt/bin/i686-elf-gcc
+LD = ccache ../../cross/opt/bin/i686-elf-ld
+AR = ccache ../../cross/opt/bin/i686-elf-ar
+
+CFLAGS = $(CFLAGS_DEFAULT) -I../ -I../libc/inc/ -Duserspace
+
+all: libtxt
+
+%.o: %.c
+ @$(CC) -c $(CFLAGS) $< -o $@
+
+libtxt: $(COBJS)
+ @mkdir -p ../../build/
+ @$(AR) rcs ../../build/libtxt.a $+
+
+clean:
+ @find . -name "*.o" -type f -delete
diff --git a/libtxt/html.c b/libs/libtxt/html.c
index f40f7b3..9295e17 100644
--- a/libtxt/html.c
+++ b/libs/libtxt/html.c
@@ -2,13 +2,13 @@
// HTML parsing is mainly based on the XML parser
#include <assert.h>
-#include <gui.h>
-#include <html.h>
+#include <libgui/gui.h>
+#include <libtxt/html.h>
+#include <libtxt/xml.h>
#include <list.h>
#include <mem.h>
#include <print.h>
#include <str.h>
-#include <xml.h>
static int is_self_closing(const char *tag)
{
diff --git a/libtxt/inc/html.h b/libs/libtxt/html.h
index c1b29f2..c1b29f2 100644
--- a/libtxt/inc/html.h
+++ b/libs/libtxt/html.h
diff --git a/libtxt/keymap.c b/libs/libtxt/keymap.c
index 175c715..67054f6 100644
--- a/libtxt/keymap.c
+++ b/libs/libtxt/keymap.c
@@ -1,7 +1,7 @@
// MIT License, Copyright (c) 2020 Marvin Borner
#include <def.h>
-#include <keymap.h>
+#include <libtxt/keymap.h>
#include <mem.h>
#include <print.h>
#include <sys.h>
diff --git a/libtxt/inc/keymap.h b/libs/libtxt/keymap.h
index 9f1966e..9f1966e 100644
--- a/libtxt/inc/keymap.h
+++ b/libs/libtxt/keymap.h
diff --git a/libtxt/xml.c b/libs/libtxt/xml.c
index e42af8c..9a5fd76 100644
--- a/libtxt/xml.c
+++ b/libs/libtxt/xml.c
@@ -2,9 +2,9 @@
// MIT License, Copyright (c) 2020 Marvin Borner
#include <assert.h>
+#include <libtxt/xml.h>
#include <mem.h>
#include <str.h>
-#include <xml.h>
static const char *str_findchr(const char *start, const char *end, int c)
{
diff --git a/libtxt/inc/xml.h b/libs/libtxt/xml.h
index 43a8005..43a8005 100644
--- a/libtxt/inc/xml.h
+++ b/libs/libtxt/xml.h
diff --git a/libtxt/Makefile b/libtxt/Makefile
deleted file mode 100644
index d0d4c17..0000000
--- a/libtxt/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# MIT License, Copyright (c) 2020 Marvin Borner
-
-COBJS = keymap.o #xml.o html.o
-CC = ccache ../cross/opt/bin/i686-elf-gcc
-LD = ccache ../cross/opt/bin/i686-elf-ld
-AR = ccache ../cross/opt/bin/i686-elf-ar
-
-CFLAGS = $(CFLAGS_DEFAULT) -Iinc/ -I../libc/inc/ -I../libgui/inc/ -fPIE -Duserspace
-
-all: libtxt
-
-%.o: %.c
- @$(CC) -c $(CFLAGS) $< -o $@
-
-libtxt: $(COBJS)
- @mkdir -p ../build/
- @$(AR) rcs ../build/libtxt.a $+
-
-clean:
- @find . -name "*.o" -type f -delete
diff --git a/run b/run
index 27a7f5f..e5af53a 100755
--- a/run
+++ b/run
@@ -213,9 +213,9 @@ make_sync() {
rm -f compile_commands.json
output=$($MAKE --always-make --dry-run)
- echo "$output" | make_append_commands libc libk libc
- echo "$output" | make_append_commands libk libgui libgui
- echo "$output" | make_append_commands libgui libtxt libtxt
+ echo "$output" | make_append_commands libc libk libs/libc
+ echo "$output" | make_append_commands libk libgui libs/libgui
+ echo "$output" | make_append_commands libgui libtxt libs/libtxt
echo "$output" | make_append_commands libtxt kernel kernel
echo "$output" | make_append_commands kernel boot boot
echo "$output" | make_append_commands boot apps apps