2019-04-20 22:09:39 -04:00
|
|
|
include ../Makefile.common
|
|
|
|
|
2018-10-28 04:36:21 -04:00
|
|
|
AK_OBJS = \
|
|
|
|
../AK/StringImpl.o \
|
|
|
|
../AK/String.o \
|
2019-04-15 20:39:16 -04:00
|
|
|
../AK/StringView.o \
|
2018-10-28 04:36:21 -04:00
|
|
|
../AK/StringBuilder.o \
|
|
|
|
../AK/FileSystemPath.o \
|
2019-02-07 02:46:52 -05:00
|
|
|
../AK/StdLibExtras.o \
|
2019-06-17 13:47:35 -04:00
|
|
|
../AK/JsonValue.o \
|
|
|
|
../AK/JsonArray.o \
|
|
|
|
../AK/JsonObject.o \
|
2019-05-17 09:35:30 -04:00
|
|
|
../AK/MappedFile.o
|
2018-10-28 04:36:21 -04:00
|
|
|
|
|
|
|
LIBC_OBJS = \
|
2019-03-08 06:22:55 -05:00
|
|
|
SharedBuffer.o \
|
2018-10-22 07:57:25 -04:00
|
|
|
stdio.o \
|
2018-10-22 08:06:22 -04:00
|
|
|
unistd.o \
|
2018-10-23 04:12:50 -04:00
|
|
|
string.o \
|
2019-02-24 09:19:32 -05:00
|
|
|
strings.o \
|
2018-10-24 03:48:24 -04:00
|
|
|
mman.o \
|
2018-10-24 06:43:52 -04:00
|
|
|
dirent.o \
|
2019-05-01 20:23:39 -04:00
|
|
|
malloc.o \
|
2018-10-24 06:43:52 -04:00
|
|
|
stdlib.o \
|
2018-10-25 11:29:49 -04:00
|
|
|
time.o \
|
2018-10-26 08:56:21 -04:00
|
|
|
utsname.o \
|
2018-10-28 04:36:21 -04:00
|
|
|
assert.o \
|
2018-10-30 20:06:57 -04:00
|
|
|
signal.o \
|
2018-10-31 12:50:43 -04:00
|
|
|
getopt.o \
|
|
|
|
scanf.o \
|
2018-10-31 14:49:22 -04:00
|
|
|
pwd.o \
|
2018-11-06 16:27:51 -05:00
|
|
|
grp.o \
|
2018-11-05 10:40:48 -05:00
|
|
|
times.o \
|
2018-11-05 12:16:00 -05:00
|
|
|
termcap.o \
|
2018-11-06 07:40:23 -05:00
|
|
|
stat.o \
|
2018-11-07 04:23:16 -05:00
|
|
|
mntent.o \
|
2018-11-10 18:44:04 -05:00
|
|
|
ctype.o \
|
2018-11-11 04:38:33 -05:00
|
|
|
fcntl.o \
|
|
|
|
termios.o \
|
2018-11-11 09:36:40 -05:00
|
|
|
ulimit.o \
|
|
|
|
qsort.o \
|
2018-11-16 07:11:21 -05:00
|
|
|
ioctl.o \
|
2018-12-19 15:14:55 -05:00
|
|
|
utime.o \
|
2019-01-15 17:12:20 -05:00
|
|
|
sys/select.o \
|
2019-02-14 09:26:06 -05:00
|
|
|
sys/socket.o \
|
2019-02-24 09:19:32 -05:00
|
|
|
sys/wait.o \
|
2019-05-09 21:19:25 -04:00
|
|
|
sys/uio.o \
|
2019-01-23 01:27:41 -05:00
|
|
|
poll.o \
|
2019-02-07 20:38:21 -05:00
|
|
|
locale.o \
|
2019-03-12 10:51:42 -04:00
|
|
|
arpa/inet.o \
|
2019-04-21 18:13:41 -04:00
|
|
|
netdb.o \
|
2019-05-23 09:32:30 -04:00
|
|
|
sched.o \
|
|
|
|
dlfcn.o
|
2018-10-22 07:57:25 -04:00
|
|
|
|
2019-05-23 04:14:19 -04:00
|
|
|
ASM_OBJS = setjmp.ao crti.ao crtn.ao
|
2019-02-07 19:24:52 -05:00
|
|
|
|
2019-02-22 04:45:32 -05:00
|
|
|
CPP_OBJS = $(AK_OBJS) $(WIDGETS_OBJS) $(LIBC_OBJS)
|
2018-10-28 04:36:21 -04:00
|
|
|
|
2019-02-26 07:30:57 -05:00
|
|
|
LIBRARY = libc.a
|
2019-04-20 22:09:39 -04:00
|
|
|
DEFINES += -DUSERLAND
|
2018-10-22 07:57:25 -04:00
|
|
|
|
2019-03-27 07:48:21 -04:00
|
|
|
all: $(LIBRARY) startfiles
|
|
|
|
|
|
|
|
startfiles:
|
2019-04-04 21:58:40 -04:00
|
|
|
@echo "CXX crt0.o"; $(CXX) $(CXXFLAGS) -o crt0.o -c crt0.cpp
|
2019-03-27 07:48:21 -04:00
|
|
|
cp crti.ao crti.o
|
|
|
|
cp crtn.ao crtn.o
|
2018-10-22 07:57:25 -04:00
|
|
|
|
2019-02-07 19:24:52 -05:00
|
|
|
$(LIBRARY): $(CPP_OBJS) $(ASM_OBJS)
|
|
|
|
@echo "LIB $@"; $(AR) rcs $@ $(CPP_OBJS) $(ASM_OBJS)
|
2018-10-22 07:57:25 -04:00
|
|
|
|
|
|
|
.cpp.o:
|
|
|
|
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
|
|
|
|
|
2019-03-27 07:48:21 -04:00
|
|
|
%.ao: %.S
|
|
|
|
@echo "AS $@"; $(AS) -o $@ $<
|
|
|
|
|
2019-02-01 22:41:59 -05:00
|
|
|
-include $(OBJS:%.o=%.d)
|
|
|
|
|
2018-10-22 07:57:25 -04:00
|
|
|
clean:
|
2019-02-07 19:24:52 -05:00
|
|
|
@echo "CLEAN"; rm -f $(LIBRARY) $(CPP_OBJS) $(ASM_OBJS) *.d
|
2018-10-22 07:57:25 -04:00
|
|
|
|
2019-05-23 08:10:37 -04:00
|
|
|
install: $(LIBRARY) startfiles
|
2019-05-08 09:50:24 -04:00
|
|
|
mkdir -p ../Root/usr/include
|
|
|
|
mkdir -p ../Root/usr/lib
|
2019-04-17 11:29:45 -04:00
|
|
|
# Copy headers
|
2019-05-08 09:50:24 -04:00
|
|
|
rsync -r -a --include '*/' --include '*.h' --exclude '*' . ../Root/usr/include
|
2019-04-17 11:29:45 -04:00
|
|
|
# Install the library
|
2019-05-08 09:50:24 -04:00
|
|
|
cp $(LIBRARY) ../Root/usr/lib
|
|
|
|
cp crt0.o ../Root/usr/lib/
|
|
|
|
cp crti.ao ../Root/usr/lib/crti.o
|
|
|
|
cp crtn.ao ../Root/usr/lib/crtn.o
|