2021-04-28 02:18:12 +02:00
|
|
|
ifndef GCC
|
|
|
|
GCC=kos32-gcc
|
|
|
|
endif
|
2021-04-27 18:33:31 +02:00
|
|
|
|
|
|
|
KPACK=kpack
|
|
|
|
FASM=fasm
|
|
|
|
|
2021-06-09 05:17:46 +02:00
|
|
|
CFLAGS = -c -nostdinc -I../include -DGNUC -D_BUILD_LIBC -fno-common -Os -fno-builtin -fno-leading-underscore -fno-pie
|
2021-04-27 18:33:31 +02:00
|
|
|
|
|
|
|
SRC=libc.c
|
2021-06-10 18:02:15 +02:00
|
|
|
LIB=libc.obj
|
2021-04-27 18:33:31 +02:00
|
|
|
|
|
|
|
all:
|
|
|
|
$(MAKE) -C ../linuxtools/src
|
2021-06-10 18:02:15 +02:00
|
|
|
mkdir -p exports
|
2021-04-27 18:33:31 +02:00
|
|
|
../linuxtools/ExportGen symbols.txt exports/exports.c
|
2021-06-10 18:02:15 +02:00
|
|
|
$(FASM) crt/crt0.asm ../../bin/lib/crt0.o
|
2021-04-28 02:18:12 +02:00
|
|
|
$(GCC) $(CFLAGS) $(SRC) -o $(LIB)
|
2021-04-27 18:33:31 +02:00
|
|
|
$(KPACK) $(LIB)
|
2021-04-28 02:18:12 +02:00
|
|
|
../linuxtools/LoaderGen symbols.txt ../loader
|
|
|
|
../linuxtools/LoaderBuild ../loader
|
2021-05-10 00:12:43 +02:00
|
|
|
$(MAKE) -C libtcc
|
2021-04-28 02:18:12 +02:00
|
|
|
rm -rf exports
|
2021-04-27 18:33:31 +02:00
|
|
|
install:
|
|
|
|
cp -f ../lib/libc.obj ~/.kex/root/RD/1/LIB
|
|
|
|
|
|
|
|
clean:
|
2021-06-10 18:02:15 +02:00
|
|
|
rm ../../bin/lib/libc.obj.a ../../bin/lib/libtcc.a
|