2018-10-28 09:36:21 +01:00
|
|
|
AK_OBJS = \
|
|
|
|
../AK/StringImpl.o \
|
|
|
|
../AK/String.o \
|
|
|
|
../AK/StringBuilder.o \
|
|
|
|
../AK/FileSystemPath.o \
|
2019-02-07 08:46:52 +01:00
|
|
|
../AK/StdLibExtras.o \
|
2019-04-03 13:51:49 +02:00
|
|
|
../AK/MappedFile.o \
|
2018-10-28 09:36:21 +01:00
|
|
|
../AK/kmalloc.o
|
|
|
|
|
|
|
|
LIBC_OBJS = \
|
2019-03-08 12:22:55 +01:00
|
|
|
SharedBuffer.o \
|
2018-10-22 13:57:25 +02:00
|
|
|
stdio.o \
|
2018-10-22 14:06:22 +02:00
|
|
|
unistd.o \
|
2018-10-23 10:12:50 +02:00
|
|
|
string.o \
|
2019-02-24 15:19:32 +01:00
|
|
|
strings.o \
|
2018-10-24 09:48:24 +02:00
|
|
|
mman.o \
|
2018-10-24 12:43:52 +02:00
|
|
|
dirent.o \
|
|
|
|
stdlib.o \
|
2018-10-25 17:29:49 +02:00
|
|
|
time.o \
|
2018-10-26 14:56:21 +02:00
|
|
|
utsname.o \
|
2018-10-28 09:36:21 +01:00
|
|
|
assert.o \
|
2018-10-31 01:06:57 +01:00
|
|
|
signal.o \
|
2018-10-31 17:50:43 +01:00
|
|
|
getopt.o \
|
|
|
|
scanf.o \
|
2018-10-31 19:49:22 +01:00
|
|
|
pwd.o \
|
2018-11-06 22:27:51 +01:00
|
|
|
grp.o \
|
2018-11-05 16:40:48 +01:00
|
|
|
times.o \
|
2018-11-05 18:16:00 +01:00
|
|
|
termcap.o \
|
2018-11-06 13:40:23 +01:00
|
|
|
stat.o \
|
2018-11-07 10:23:16 +01:00
|
|
|
mntent.o \
|
2018-11-11 00:44:04 +01:00
|
|
|
ctype.o \
|
2018-11-11 10:38:33 +01:00
|
|
|
fcntl.o \
|
|
|
|
termios.o \
|
2018-11-11 15:36:40 +01:00
|
|
|
ulimit.o \
|
|
|
|
qsort.o \
|
2018-11-16 13:11:21 +01:00
|
|
|
ioctl.o \
|
2018-12-19 21:14:55 +01:00
|
|
|
utime.o \
|
2019-01-15 23:12:20 +01:00
|
|
|
sys/select.o \
|
2019-02-14 15:26:06 +01:00
|
|
|
sys/socket.o \
|
2019-02-24 15:19:32 +01:00
|
|
|
sys/wait.o \
|
2019-01-23 07:27:41 +01:00
|
|
|
poll.o \
|
2019-02-08 02:38:21 +01:00
|
|
|
locale.o \
|
2019-03-12 15:51:42 +01:00
|
|
|
arpa/inet.o \
|
2019-03-27 12:48:21 +01:00
|
|
|
netdb.o
|
2018-10-22 13:57:25 +02:00
|
|
|
|
2019-03-27 12:48:21 +01:00
|
|
|
ASM_OBJS = setjmp.no crti.ao crtn.ao
|
2019-02-08 01:24:52 +01:00
|
|
|
|
2019-02-22 10:45:32 +01:00
|
|
|
CPP_OBJS = $(AK_OBJS) $(WIDGETS_OBJS) $(LIBC_OBJS)
|
2018-10-28 09:36:21 +01:00
|
|
|
|
2019-02-26 13:30:57 +01:00
|
|
|
LIBRARY = libc.a
|
2019-02-22 14:43:12 +01:00
|
|
|
STANDARD_FLAGS = -std=c++17
|
2019-02-15 12:39:16 +01:00
|
|
|
WARNING_FLAGS = -Wextra -Wall -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough
|
2019-03-27 12:48:21 +01:00
|
|
|
FLAVOR_FLAGS = -fno-exceptions -fno-rtti -fno-sized-deallocation
|
2019-02-17 15:17:21 +01:00
|
|
|
OPTIMIZATION_FLAGS = -Os
|
2018-10-22 13:57:25 +02:00
|
|
|
INCLUDE_FLAGS = -I.. -I.
|
|
|
|
|
2018-10-28 09:36:21 +01:00
|
|
|
DEFINES = -DSERENITY -DUSERLAND -DSANITIZE_PTRS
|
2018-10-22 13:57:25 +02:00
|
|
|
|
2019-02-22 14:43:12 +01:00
|
|
|
CXXFLAGS = -MMD -MP $(WARNING_FLAGS) $(OPTIMIZATION_FLAGS) $(FLAVOR_FLAGS) $(STANDARD_FLAGS) $(INCLUDE_FLAGS) $(DEFINES)
|
|
|
|
CXX = i686-pc-serenity-g++
|
|
|
|
LD = i686-pc-serenity-ld
|
|
|
|
AR = i686-pc-serenity-ar
|
2019-03-27 12:48:21 +01:00
|
|
|
AS = i686-pc-serenity-as
|
2018-10-22 13:57:25 +02:00
|
|
|
|
2019-03-27 12:48:21 +01:00
|
|
|
all: $(LIBRARY) startfiles
|
|
|
|
|
|
|
|
startfiles:
|
|
|
|
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o crt0.o -c crt0.cpp
|
|
|
|
cp crti.ao crti.o
|
|
|
|
cp crtn.ao crtn.o
|
2018-10-22 13:57:25 +02:00
|
|
|
|
2019-02-08 01:24:52 +01:00
|
|
|
$(LIBRARY): $(CPP_OBJS) $(ASM_OBJS)
|
|
|
|
@echo "LIB $@"; $(AR) rcs $@ $(CPP_OBJS) $(ASM_OBJS)
|
2018-10-22 13:57:25 +02:00
|
|
|
|
|
|
|
.cpp.o:
|
|
|
|
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
|
|
|
|
|
2019-02-08 01:24:52 +01:00
|
|
|
%.no: %.asm
|
|
|
|
@echo "NASM $@"; nasm -f elf -o $@ $<
|
|
|
|
|
2019-03-27 12:48:21 +01:00
|
|
|
%.ao: %.S
|
|
|
|
@echo "AS $@"; $(AS) -o $@ $<
|
|
|
|
|
2019-02-02 04:41:59 +01:00
|
|
|
-include $(OBJS:%.o=%.d)
|
|
|
|
|
2018-10-22 13:57:25 +02:00
|
|
|
clean:
|
2019-02-08 01:24:52 +01:00
|
|
|
@echo "CLEAN"; rm -f $(LIBRARY) $(CPP_OBJS) $(ASM_OBJS) *.d
|
2018-10-22 13:57:25 +02:00
|
|
|
|