2018-10-28 11:36:21 +03:00
|
|
|
AK_OBJS = \
|
|
|
|
../AK/StringImpl.o \
|
|
|
|
../AK/String.o \
|
|
|
|
../AK/StringBuilder.o \
|
|
|
|
../AK/FileSystemPath.o \
|
|
|
|
../AK/kmalloc.o
|
|
|
|
|
|
|
|
LIBC_OBJS = \
|
2018-10-22 14:57:25 +03:00
|
|
|
stdio.o \
|
2018-10-22 15:06:22 +03:00
|
|
|
unistd.o \
|
2018-10-23 11:12:50 +03:00
|
|
|
string.o \
|
2018-10-24 10:48:24 +03:00
|
|
|
mman.o \
|
2018-10-24 13:43:52 +03:00
|
|
|
dirent.o \
|
|
|
|
stdlib.o \
|
2018-10-25 18:29:49 +03:00
|
|
|
time.o \
|
2018-10-26 15:56:21 +03:00
|
|
|
utsname.o \
|
2018-10-28 11:36:21 +03:00
|
|
|
assert.o \
|
2018-10-31 03:06:57 +03:00
|
|
|
signal.o \
|
2018-10-31 19:50:43 +03:00
|
|
|
getopt.o \
|
|
|
|
scanf.o \
|
2018-10-31 21:49:22 +03:00
|
|
|
pwd.o \
|
2018-11-07 00:27:51 +03:00
|
|
|
grp.o \
|
2018-11-05 18:40:48 +03:00
|
|
|
times.o \
|
2018-11-05 20:16:00 +03:00
|
|
|
termcap.o \
|
|
|
|
setjmp.o \
|
2018-11-06 15:40:23 +03:00
|
|
|
stat.o \
|
2018-11-07 12:23:16 +03:00
|
|
|
mntent.o \
|
2018-11-11 02:44:04 +03:00
|
|
|
ctype.o \
|
2018-10-22 15:06:22 +03:00
|
|
|
entry.o
|
2018-10-22 14:57:25 +03:00
|
|
|
|
2018-10-28 11:36:21 +03:00
|
|
|
OBJS = $(AK_OBJS) $(LIBC_OBJS)
|
|
|
|
|
2018-10-22 14:57:25 +03:00
|
|
|
LIBRARY = LibC.a
|
|
|
|
ARCH_FLAGS =
|
2018-10-31 04:09:11 +03:00
|
|
|
STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib -nostdinc
|
2018-10-22 14:57:25 +03:00
|
|
|
LIBC_FLAGS = -ffreestanding -fno-stack-protector -fno-ident
|
|
|
|
WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings
|
2018-11-09 16:29:00 +03:00
|
|
|
FLAVOR_FLAGS = -fomit-frame-pointer -mregparm=3 -march=i386 -m32 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fmerge-all-constants -fno-unroll-loops -fno-pie -fno-pic
|
|
|
|
OPTIMIZATION_FLAGS = -Oz -fno-asynchronous-unwind-tables
|
2018-10-22 14:57:25 +03:00
|
|
|
INCLUDE_FLAGS = -I.. -I.
|
|
|
|
|
2018-10-28 11:36:21 +03:00
|
|
|
DEFINES = -DSERENITY -DUSERLAND -DSANITIZE_PTRS
|
2018-10-22 14:57:25 +03:00
|
|
|
|
|
|
|
CXXFLAGS = $(WARNING_FLAGS) $(OPTIMIZATION_FLAGS) $(LIBC_FLAGS) $(FLAVOR_FLAGS) $(ARCH_FLAGS) $(STANDARD_FLAGS) $(INCLUDE_FLAGS) $(DEFINES)
|
2018-11-09 16:29:00 +03:00
|
|
|
CXX = clang
|
2018-10-22 14:57:25 +03:00
|
|
|
LD = ld
|
|
|
|
AR = ar
|
|
|
|
LDFLAGS = -T linker.ld --strip-debug -melf_i386 --gc-sections --build-id=none -z norelro -z now
|
|
|
|
|
|
|
|
all: $(LIBRARY)
|
|
|
|
|
|
|
|
$(LIBRARY): $(OBJS)
|
|
|
|
@echo "LIB $@"; $(AR) rcs $@ $(OBJS)
|
|
|
|
|
|
|
|
.cpp.o:
|
|
|
|
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
|
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "CLEAN"; rm -f $(LIBRARY) $(OBJS)
|
|
|
|
|