2013-03-19 18:28:32 -04:00
|
|
|
SOFTWARE_MEANT_FOR_SORTIX=1
|
2012-09-10 17:36:15 -04:00
|
|
|
include ../compiler.mak
|
|
|
|
include ../version.mak
|
|
|
|
include ../dirs.mak
|
|
|
|
|
|
|
|
ifndef OPTLEVEL
|
2013-03-19 18:28:32 -04:00
|
|
|
OPTLEVEL:=-g -O2 -fno-omit-frame-pointer
|
2011-08-05 08:25:00 -04:00
|
|
|
endif
|
|
|
|
|
2012-09-10 17:36:15 -04:00
|
|
|
CPUDIR:=$(CPU)
|
|
|
|
|
|
|
|
CPPINCLUDES=-I preproc
|
2013-03-19 18:28:32 -04:00
|
|
|
CPPFLAGS=-DLIBC_LIBRARY $(CPPINCLUDES)
|
|
|
|
FLAGS=-Wall -Wextra $(OPTLEVEL)
|
|
|
|
CFLAGS=-std=gnu99
|
|
|
|
CXXFLAGS=-std=gnu++11 -fno-exceptions -fno-rtti
|
|
|
|
ASFLAGS=
|
2012-02-11 20:03:34 -05:00
|
|
|
|
2012-09-21 17:57:47 -04:00
|
|
|
FREEOBJS=\
|
2013-06-24 17:57:51 -04:00
|
|
|
assert/_assert.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
clearerr.o \
|
|
|
|
c++.o \
|
2013-06-24 18:07:57 -04:00
|
|
|
ctype/ctype.o \
|
2013-06-21 18:30:45 -04:00
|
|
|
dirent/alphasort.o \
|
2013-06-24 07:37:04 -04:00
|
|
|
dirent/dir.o \
|
2013-06-24 13:20:46 -04:00
|
|
|
dirent/versionsort.o \
|
2012-09-26 11:56:39 -04:00
|
|
|
errno.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
fabs.o \
|
|
|
|
fbufsize.o \
|
|
|
|
fclose.o \
|
2013-03-20 17:12:20 -04:00
|
|
|
fdeletefile.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
feof.o \
|
|
|
|
ferror.o \
|
|
|
|
fflush.o \
|
2012-12-08 15:14:29 -05:00
|
|
|
fflush_stop_reading.o \
|
|
|
|
fflush_stop_writing.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
fgetc.o \
|
|
|
|
fgets.o \
|
|
|
|
flbf.o \
|
2013-10-27 17:41:52 -04:00
|
|
|
flushlbf.o \
|
2013-10-27 17:30:56 -04:00
|
|
|
fnewfile.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
format.o \
|
|
|
|
fpending.o \
|
|
|
|
fpurge.o \
|
|
|
|
fputc.o \
|
|
|
|
fputs.o \
|
|
|
|
freadable.o \
|
|
|
|
freading.o \
|
|
|
|
fread.o \
|
|
|
|
fregister.o \
|
2013-03-20 17:12:20 -04:00
|
|
|
fresetfile.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
fscanf.o \
|
|
|
|
fseek.o \
|
|
|
|
fseeko.o \
|
2013-03-20 14:01:35 -04:00
|
|
|
fsetdefaultbuf.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
fseterr.o \
|
|
|
|
fsetlocking.o \
|
2013-03-20 17:12:20 -04:00
|
|
|
fshutdown.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
ftell.o \
|
|
|
|
ftello.o \
|
|
|
|
fwritable.o \
|
|
|
|
fwrite.o \
|
|
|
|
fwriting.o \
|
2012-09-26 13:26:04 -04:00
|
|
|
getdelim.o \
|
|
|
|
getline.o \
|
2012-09-26 13:40:00 -04:00
|
|
|
op-new.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
rewind.o \
|
2013-03-20 14:01:35 -04:00
|
|
|
setbuf.o \
|
|
|
|
setvbuf.o \
|
2013-01-08 09:10:24 -05:00
|
|
|
sigaddset.o \
|
|
|
|
sigdelset.o \
|
|
|
|
sigemptyset.o \
|
2013-04-22 04:06:44 -04:00
|
|
|
sigfillset.o \
|
2013-01-08 09:10:24 -05:00
|
|
|
sigismember.o \
|
2012-09-23 06:32:53 -04:00
|
|
|
sprint.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
sscanf.o \
|
2013-06-24 17:52:59 -04:00
|
|
|
stdlib/abort.o \
|
|
|
|
stdlib/abs.o \
|
|
|
|
stdlib/atof.o \
|
|
|
|
stdlib/atoi.o \
|
|
|
|
stdlib/atoll.o \
|
|
|
|
stdlib/atol.o \
|
|
|
|
stdlib/bsearch.o \
|
|
|
|
stdlib/calloc.o \
|
|
|
|
stdlib/div.o \
|
|
|
|
stdlib/heap.o \
|
|
|
|
stdlib/integer.o \
|
|
|
|
stdlib/ldiv.o \
|
|
|
|
stdlib/lldiv.o \
|
|
|
|
stdlib/mblen.o \
|
|
|
|
stdlib/mbstowcs.o \
|
|
|
|
stdlib/mbtowc.o \
|
|
|
|
stdlib/qsort.o \
|
|
|
|
stdlib/strtod.o \
|
|
|
|
stdlib/strtof.o \
|
|
|
|
stdlib/strtold.o \
|
|
|
|
stdlib/wcstombs.o \
|
|
|
|
stdlib/wctomb.o \
|
2013-06-12 07:35:22 -04:00
|
|
|
string/memccpy.o \
|
|
|
|
string/memchr.o \
|
|
|
|
string/memcmp.o \
|
|
|
|
string/memcpy.o \
|
|
|
|
string/memmove.o \
|
|
|
|
string/memset.o \
|
|
|
|
string/stpcpy.o \
|
|
|
|
string/stpncpy.o \
|
|
|
|
string/strcasecmp.o \
|
|
|
|
string/strcat.o \
|
|
|
|
string/strchrnul.o \
|
|
|
|
string/strchr.o \
|
|
|
|
string/strcmp.o \
|
|
|
|
string/strcoll.o \
|
|
|
|
string/strcpy.o \
|
|
|
|
string/strcspn.o \
|
|
|
|
string/strdup.o \
|
|
|
|
string/strerror.o \
|
|
|
|
string/strlen.o \
|
|
|
|
string/strncasecmp.o \
|
|
|
|
string/strncat.o \
|
|
|
|
string/strncmp.o \
|
|
|
|
string/strncpy.o \
|
|
|
|
string/strndup.o \
|
|
|
|
string/strnlen.o \
|
|
|
|
string/strpbrk.o \
|
|
|
|
string/strrchr.o \
|
|
|
|
string/strsignal.o \
|
|
|
|
string/strspn.o \
|
|
|
|
string/strstr.o \
|
|
|
|
string/strtok.o \
|
|
|
|
string/strtok_r.o \
|
2013-06-24 13:11:46 -04:00
|
|
|
string/strverscmp.o \
|
2013-06-12 07:35:22 -04:00
|
|
|
string/strxfrm.o \
|
2013-03-21 20:09:03 -04:00
|
|
|
time/asctime.o \
|
|
|
|
time/asctime_r.o \
|
2013-05-15 13:09:37 -04:00
|
|
|
time/gmtime.o \
|
|
|
|
time/gmtime_r.o \
|
2013-03-22 21:41:28 -04:00
|
|
|
time/mktime.o \
|
2013-01-09 10:07:27 -05:00
|
|
|
timespec.o \
|
2013-03-21 19:13:30 -04:00
|
|
|
time/strftime.o \
|
2013-03-22 21:41:28 -04:00
|
|
|
time/timegm.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
ungetc.o \
|
|
|
|
vfscanf.o \
|
|
|
|
vsscanf.o \
|
2013-06-12 09:11:15 -04:00
|
|
|
wchar/mbrlen.o \
|
|
|
|
wchar/mbrtowc.o \
|
|
|
|
wchar/mbsrtowcs.o \
|
|
|
|
wchar/wcrtomb.o \
|
|
|
|
wchar/wcscat.o \
|
|
|
|
wchar/wcschrnul.o \
|
|
|
|
wchar/wcschr.o \
|
|
|
|
wchar/wcscmp.o \
|
|
|
|
wchar/wcscpy.o \
|
|
|
|
wchar/wcscspn.o \
|
|
|
|
wchar/wcslen.o \
|
|
|
|
wchar/wcsncat.o \
|
|
|
|
wchar/wcsncpy.o \
|
|
|
|
wchar/wcsrchr.o \
|
|
|
|
wchar/wcsrtombs.o \
|
|
|
|
wchar/wcsspn.o \
|
|
|
|
wchar/wcstok.o \
|
2013-06-24 18:02:01 -04:00
|
|
|
wctype/wctype.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
|
|
|
|
HOSTEDOBJS=\
|
2012-07-25 17:00:17 -04:00
|
|
|
access.o \
|
2013-05-11 19:24:42 -04:00
|
|
|
alarmns.o \
|
|
|
|
alarm.o \
|
2013-03-19 17:40:37 -04:00
|
|
|
arpa/inet/inet_addr.o \
|
|
|
|
arpa/inet/inet_ntoa.o \
|
|
|
|
arpa/inet/inet_ntop.o \
|
|
|
|
arpa/inet/inet_pton.o \
|
2013-01-06 10:49:36 -05:00
|
|
|
calltrace.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
chdir.o \
|
|
|
|
chmod.o \
|
2012-10-23 14:02:33 -04:00
|
|
|
chown.o \
|
2013-05-29 18:32:22 -04:00
|
|
|
chroot.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
close.o \
|
2013-04-16 05:44:29 -04:00
|
|
|
confstr.o \
|
2013-01-06 10:49:36 -05:00
|
|
|
$(CPUDIR)/calltrace.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
$(CPUDIR)/fork.o \
|
2013-03-31 09:00:12 -04:00
|
|
|
$(CPUDIR)/setjmp.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
$(CPUDIR)/signal.o \
|
2013-01-12 13:48:27 -05:00
|
|
|
$(CPUDIR)/syscall.o \
|
2013-01-12 20:27:51 -05:00
|
|
|
creat.o \
|
2013-06-24 07:37:04 -04:00
|
|
|
dirent/fddir-sortix.o \
|
2013-06-21 18:12:10 -04:00
|
|
|
dirent/scandir.o \
|
2012-12-15 20:10:19 -05:00
|
|
|
dispmsg_issue.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
dlfcn.o \
|
2013-06-27 14:47:24 -04:00
|
|
|
dup2.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
dup.o \
|
|
|
|
errorprint.o \
|
2012-09-26 10:11:38 -04:00
|
|
|
execle.o \
|
|
|
|
execl.o \
|
|
|
|
execlp.o \
|
|
|
|
execve.o \
|
|
|
|
execv.o \
|
|
|
|
execvpe.o \
|
|
|
|
execvp.o \
|
2012-09-06 16:30:09 -04:00
|
|
|
_exit.o \
|
2012-10-23 17:55:33 -04:00
|
|
|
faccessat.o \
|
2013-05-29 08:03:53 -04:00
|
|
|
fchdirat.o \
|
2012-10-24 07:06:12 -04:00
|
|
|
fchdir.o \
|
2012-10-24 18:29:48 -04:00
|
|
|
fchmodat.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
fchmod.o \
|
2012-10-24 13:43:11 -04:00
|
|
|
fchownat.o \
|
2012-10-24 13:52:28 -04:00
|
|
|
fchown.o \
|
2013-05-29 18:32:22 -04:00
|
|
|
fchrootat.o \
|
|
|
|
fchroot.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
fcloseall.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
fcntl.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
fdio.o \
|
2013-04-21 18:29:58 -04:00
|
|
|
fgetpos.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
fileno.o \
|
2012-09-26 10:11:38 -04:00
|
|
|
fork.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
fpipe.o \
|
2013-03-20 17:20:22 -04:00
|
|
|
freopen.o \
|
2013-04-21 18:29:58 -04:00
|
|
|
fsetpos.o \
|
2013-06-24 17:24:18 -04:00
|
|
|
fsmarshall/fsm_bootstraprootfd.o \
|
|
|
|
fsmarshall/fsm_closechannel.o \
|
|
|
|
fsmarshall/fsm_closeserver.o \
|
|
|
|
fsmarshall/fsm_fsbind.o \
|
|
|
|
fsmarshall/fsm_listen.o \
|
|
|
|
fsmarshall/fsm_mkserver.o \
|
|
|
|
fsmarshall/fsm_recv.o \
|
|
|
|
fsmarshall/fsm_send.o \
|
2012-08-07 18:19:44 -04:00
|
|
|
fstatat.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
fstat.o \
|
2013-03-20 08:16:12 -04:00
|
|
|
fsync.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
ftruncate.o \
|
2013-03-19 17:01:01 -04:00
|
|
|
futimens.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
getc.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
getcwd.o \
|
|
|
|
getdtablesize.o \
|
2013-01-12 20:37:14 -05:00
|
|
|
getegid.o \
|
|
|
|
geteuid.o \
|
|
|
|
getgid.o \
|
2013-04-12 18:42:13 -04:00
|
|
|
gethostname.o \
|
2013-04-15 18:08:33 -04:00
|
|
|
getlogin.o \
|
|
|
|
getlogin_r.o \
|
2012-09-26 15:02:17 -04:00
|
|
|
getpagesize.o \
|
2013-06-11 19:02:01 -04:00
|
|
|
getpgid.o \
|
2012-09-26 10:11:38 -04:00
|
|
|
getpid.o \
|
|
|
|
getppid.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
gettermmode.o \
|
2013-01-12 20:37:14 -05:00
|
|
|
getuid.o \
|
2013-06-24 18:11:40 -04:00
|
|
|
grp/grent.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
init.o \
|
2013-03-21 16:35:51 -04:00
|
|
|
ioctl.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
ioleast.o \
|
|
|
|
isatty.o \
|
|
|
|
kernelinfo.o \
|
2012-09-28 16:50:31 -04:00
|
|
|
kill.o \
|
2013-01-14 16:58:34 -05:00
|
|
|
lchown.o \
|
2013-06-24 17:07:11 -04:00
|
|
|
libgen/basename.o \
|
|
|
|
libgen/dirname.o \
|
2012-10-25 09:43:53 -04:00
|
|
|
linkat.o \
|
2012-10-23 14:09:43 -04:00
|
|
|
link.o \
|
2012-09-07 14:52:25 -04:00
|
|
|
localeconv.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
lseek.o \
|
2012-10-25 11:35:54 -04:00
|
|
|
lstat.o \
|
2012-09-26 15:02:17 -04:00
|
|
|
memstat.o \
|
2012-10-23 18:07:39 -04:00
|
|
|
mkdirat.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
mkdir.o \
|
2013-06-01 07:24:27 -04:00
|
|
|
mkpartition.o \
|
2013-03-19 17:40:37 -04:00
|
|
|
netdb/endhostent.o \
|
|
|
|
netdb/endnetent.o \
|
|
|
|
netdb/endprotoent.o \
|
|
|
|
netdb/endservent.o \
|
|
|
|
netdb/freeaddrinfo.o \
|
|
|
|
netdb/gai_strerror.o \
|
|
|
|
netdb/getaddrinfo.o \
|
|
|
|
netdb/gethostent.o \
|
|
|
|
netdb/getnameinfo.o \
|
|
|
|
netdb/getnetbyaddr.o \
|
|
|
|
netdb/getnetbyname.o \
|
|
|
|
netdb/getnetent.o \
|
|
|
|
netdb/getprotobyname.o \
|
|
|
|
netdb/getprotobynumber.o \
|
|
|
|
netdb/getprotoent.o \
|
|
|
|
netdb/getservbyname.o \
|
|
|
|
netdb/getservbyport.o \
|
|
|
|
netdb/getservent.o \
|
|
|
|
netdb/sethostent.o \
|
|
|
|
netdb/setnetent.o \
|
|
|
|
netdb/setprotoent.o \
|
|
|
|
netdb/setservent.o \
|
2012-09-30 07:42:35 -04:00
|
|
|
openat.o \
|
2012-08-07 18:19:44 -04:00
|
|
|
open.o \
|
2013-03-22 08:58:43 -04:00
|
|
|
pathconf.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
pipe.o \
|
2012-12-29 17:09:09 -05:00
|
|
|
poll.o \
|
2013-01-14 16:58:07 -05:00
|
|
|
popen.o \
|
2012-12-29 17:09:09 -05:00
|
|
|
ppoll.o \
|
2013-05-03 15:43:01 -04:00
|
|
|
preadv.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
print.o \
|
2013-05-01 16:01:09 -04:00
|
|
|
psignal.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
putc.o \
|
2013-01-08 09:09:23 -05:00
|
|
|
pwent.o \
|
2013-05-03 15:43:01 -04:00
|
|
|
pwritev.o \
|
2012-09-28 16:50:31 -04:00
|
|
|
raise.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
readdirents.o \
|
2013-03-19 15:18:15 -04:00
|
|
|
readlinkat.o \
|
|
|
|
readlink.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
read.o \
|
2013-05-03 15:43:01 -04:00
|
|
|
readv.o \
|
2013-01-06 13:04:28 -05:00
|
|
|
removeat.o \
|
|
|
|
remove.o \
|
2012-12-20 10:19:07 -05:00
|
|
|
renameat.o \
|
|
|
|
rename.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
rmdir.o \
|
2012-09-26 15:02:17 -04:00
|
|
|
sbrk.o \
|
2012-09-07 14:36:27 -04:00
|
|
|
scanf.o \
|
2013-03-03 08:21:40 -05:00
|
|
|
select.o \
|
2013-01-12 20:37:14 -05:00
|
|
|
setegid.o \
|
|
|
|
seteuid.o \
|
|
|
|
setgid.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
setlocale.o \
|
2013-06-11 19:02:01 -04:00
|
|
|
setpgid.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
settermmode.o \
|
2013-01-12 20:37:14 -05:00
|
|
|
setuid.o \
|
2012-09-26 10:11:38 -04:00
|
|
|
sfork.o \
|
2013-04-18 06:42:04 -04:00
|
|
|
sigaction.o \
|
2012-09-28 16:50:31 -04:00
|
|
|
SIG_DFL.o \
|
|
|
|
SIG_ERR.o \
|
|
|
|
SIG_IGN.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
signal.o \
|
2013-04-18 06:59:30 -04:00
|
|
|
sigprocmask.o \
|
2012-09-21 19:09:20 -04:00
|
|
|
sleep.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
stat.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
stdio.o \
|
2013-06-24 17:52:59 -04:00
|
|
|
stdlib/canonicalize_file_name_at.o \
|
|
|
|
stdlib/canonicalize_file_name.o \
|
|
|
|
stdlib/env.o \
|
|
|
|
stdlib/_Exit.o \
|
|
|
|
stdlib/exit.o \
|
|
|
|
stdlib/mktemp.o \
|
|
|
|
stdlib/on_exit.o \
|
|
|
|
stdlib/rand.o \
|
|
|
|
stdlib/realpath.o \
|
|
|
|
stdlib/system.o \
|
2013-04-16 04:11:15 -04:00
|
|
|
sysconf.o \
|
2013-03-19 17:40:37 -04:00
|
|
|
sys/socket/accept4.o \
|
|
|
|
sys/socket/accept.o \
|
|
|
|
sys/socket/bind.o \
|
|
|
|
sys/socket/connect.o \
|
|
|
|
sys/socket/getpeername.o \
|
|
|
|
sys/socket/getsockname.o \
|
|
|
|
sys/socket/getsockopt.o \
|
|
|
|
sys/socket/listen.o \
|
|
|
|
sys/socket/recvfrom.o \
|
|
|
|
sys/socket/recvmsg.o \
|
|
|
|
sys/socket/recv.o \
|
|
|
|
sys/socket/sendmsg.o \
|
|
|
|
sys/socket/send.o \
|
|
|
|
sys/socket/sendto.o \
|
|
|
|
sys/socket/setsockopt.o \
|
|
|
|
sys/socket/shutdown.o \
|
|
|
|
sys/socket/sockatmark.o \
|
|
|
|
sys/socket/socket.o \
|
|
|
|
sys/socket/socketpair.o \
|
2013-05-12 16:10:34 -04:00
|
|
|
sys/time/gettimeofday.o \
|
2013-06-11 20:18:07 -04:00
|
|
|
tcgetpgrp.o \
|
2013-06-12 07:12:29 -04:00
|
|
|
tcgetwinsize.o \
|
2013-06-11 20:18:07 -04:00
|
|
|
tcsetpgrp.o \
|
2012-09-26 10:11:38 -04:00
|
|
|
tfork.o \
|
2013-05-12 16:10:34 -04:00
|
|
|
time/clock_getres.o \
|
|
|
|
time/clock_gettime.o \
|
|
|
|
time/clock_gettimeres.o \
|
2013-05-14 12:41:49 -04:00
|
|
|
time/clock_nanosleep.o \
|
2013-05-15 09:00:48 -04:00
|
|
|
time/clock.o \
|
2013-05-12 16:10:34 -04:00
|
|
|
time/clock_settime.o \
|
|
|
|
time/clock_settimeres.o \
|
2013-05-16 09:51:43 -04:00
|
|
|
time/ctime.o \
|
|
|
|
time/ctime_r.o \
|
2013-05-15 09:08:47 -04:00
|
|
|
time/difftime.o \
|
2013-05-16 09:51:43 -04:00
|
|
|
time/localtime.o \
|
|
|
|
time/localtime_r.o \
|
2013-05-14 12:41:49 -04:00
|
|
|
time/nanosleep.o \
|
2013-05-15 06:37:39 -04:00
|
|
|
time/timens.o \
|
2013-05-12 16:10:34 -04:00
|
|
|
time/time.o \
|
2013-10-13 17:56:58 -04:00
|
|
|
time/timer_create.o \
|
|
|
|
time/timer_delete.o \
|
|
|
|
time/timer_getoverrun.o \
|
|
|
|
time/timer_gettime.o \
|
|
|
|
time/timer_settime.o \
|
2013-05-15 08:41:42 -04:00
|
|
|
time/times.o \
|
2013-03-29 09:29:11 -04:00
|
|
|
tmpfile.o \
|
2013-04-22 05:37:29 -04:00
|
|
|
tmpnam.o \
|
2012-10-24 08:49:19 -04:00
|
|
|
truncateat.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
truncate.o \
|
2013-03-23 18:58:20 -04:00
|
|
|
ttyname.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
umask.o \
|
2012-10-23 07:50:33 -04:00
|
|
|
unlinkat.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
unlink.o \
|
2012-09-21 19:09:20 -04:00
|
|
|
usleep.o \
|
2013-03-19 17:01:01 -04:00
|
|
|
utimensat.o \
|
|
|
|
utimens.o \
|
2012-09-28 15:06:13 -04:00
|
|
|
utime.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
vscanf.o \
|
2012-09-26 10:11:38 -04:00
|
|
|
wait.o \
|
|
|
|
waitpid.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
write.o \
|
2013-05-03 15:43:01 -04:00
|
|
|
writev.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
|
|
|
|
OBJS=\
|
|
|
|
$(FREEOBJS) \
|
|
|
|
$(HOSTEDOBJS) \
|
2012-02-11 20:03:34 -05:00
|
|
|
|
2012-09-08 08:37:16 -04:00
|
|
|
CRTOBJ=\
|
|
|
|
crt1.o \
|
|
|
|
crti.o \
|
|
|
|
crtn.o \
|
|
|
|
|
|
|
|
MISCOBJ=\
|
|
|
|
$(CRTOBJ) \
|
|
|
|
|
2012-02-11 20:03:34 -05:00
|
|
|
UNPROCHEADERDIRS:=$(shell find include -type d)
|
|
|
|
UNPROCHEADERS:=$(shell find include -type f)
|
|
|
|
HEADERDIRS:=$(patsubst include%,preproc%,$(UNPROCHEADERDIRS))
|
|
|
|
HEADERS:=$(patsubst include%,preproc%,$(UNPROCHEADERS))
|
2013-03-19 18:28:32 -04:00
|
|
|
INSTALLHEADERDIRS:=$(addprefix $(DESTDIR)$(INCLUDEDIR),$(patsubst preproc%,%,$(HEADERDIRS)))
|
|
|
|
INSTALLHEADERS:=$(addprefix $(DESTDIR)$(INCLUDEDIR),$(patsubst preproc%,%,$(HEADERS)))
|
2012-02-11 20:03:34 -05:00
|
|
|
|
2012-09-21 17:57:47 -04:00
|
|
|
SORTIXOBJS:=$(addprefix sortix/,$(FREEOBJS))
|
2013-03-19 18:28:32 -04:00
|
|
|
SORTIXCPPFLAGS:=$(CPPFLAGS) -DSORTIX_KERNEL
|
|
|
|
SORTIXFLAGS:=$(FLAGS) -ffreestanding
|
|
|
|
SORTIXCFLAGS:=$(CFLAGS)
|
|
|
|
SORTIXCXXFLAGS:=$(CXXFLAGS)
|
|
|
|
ifeq ($(HOST),x86_64-sortix)
|
|
|
|
SORTIXFLAGS:=$(SORTIXFLAGS) -mno-red-zone
|
|
|
|
endif
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
BINS=libc.a libg.a libm.a libpthread.a libstdc++.a $(CRTOBJ)
|
|
|
|
BINSKERNEL=libc-sortix.a
|
|
|
|
INSTALLLIBS:=$(addprefix $(DESTDIR)$(LIBDIR)/,$(BINS))
|
|
|
|
INSTALLLIBSKERNEL:=$(addprefix $(DESTDIR)$(LIBDIR)/,$(BINSKERNEL))
|
2012-09-08 08:37:16 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
all: libs libs-kernel
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
libs: $(BINS)
|
|
|
|
|
|
|
|
libs-kernel: $(BINSKERNEL)
|
|
|
|
|
|
|
|
.PHONY: all libs headers clean install install-include-dirs install-headers \
|
|
|
|
install-lib-dirs install-libs libs-kernel
|
|
|
|
|
|
|
|
FORCE:
|
2012-09-10 15:45:38 -04:00
|
|
|
|
2012-09-23 08:04:53 -04:00
|
|
|
libc.a: $(OBJS)
|
|
|
|
$(HOSTAR) rcs $@ $(OBJS)
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2012-09-23 08:04:53 -04:00
|
|
|
libc-sortix.a: $(SORTIXOBJS)
|
|
|
|
$(HOSTAR) rcs $@ $(SORTIXOBJS)
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
libg.a:
|
|
|
|
$(HOSTAR) rcs $@
|
2012-01-08 09:45:13 -05:00
|
|
|
|
2012-09-10 17:36:15 -04:00
|
|
|
libm.a:
|
|
|
|
$(HOSTAR) rcs $@
|
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
libpthread.a:
|
2012-09-10 17:36:15 -04:00
|
|
|
$(HOSTAR) rcs $@
|
2012-01-08 09:45:13 -05:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
libstdc++.a:
|
|
|
|
$(HOSTAR) rcs $@
|
2012-09-08 08:37:16 -04:00
|
|
|
|
2012-09-10 17:36:15 -04:00
|
|
|
crt1.o: $(CPUDIR)/crt1.o
|
2012-09-08 08:37:16 -04:00
|
|
|
ln -f $< $@
|
|
|
|
|
2012-09-10 17:36:15 -04:00
|
|
|
crti.o: $(CPUDIR)/crti.o
|
2012-09-08 08:37:16 -04:00
|
|
|
ln -f $< $@
|
|
|
|
|
2012-09-10 17:36:15 -04:00
|
|
|
crtn.o: $(CPUDIR)/crtn.o
|
2012-09-08 08:37:16 -04:00
|
|
|
ln -f $< $@
|
2011-09-15 16:19:04 -04:00
|
|
|
|
2012-02-11 20:03:34 -05:00
|
|
|
# header preprocessing
|
2013-03-19 18:28:32 -04:00
|
|
|
$(OBJS) $(SORTIXOBJS): $(HEADERS)
|
|
|
|
|
2012-02-11 20:03:34 -05:00
|
|
|
$(HEADERDIRS):
|
|
|
|
mkdir -p $@
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
preproc/%: include/%
|
2012-02-11 20:03:34 -05:00
|
|
|
mxmpp -I decl $< -o $@
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
$(HEADERS): | $(HEADERDIRS)
|
|
|
|
|
2012-02-11 20:03:34 -05:00
|
|
|
headers: $(HEADERDIRS) $(HEADERS)
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2012-02-11 20:03:34 -05:00
|
|
|
# standard library
|
2013-03-19 18:28:32 -04:00
|
|
|
%.o: %.c
|
|
|
|
$(HOSTCC) -c $< -o $@ $(CPPFLAGS) $(FLAGS) $(CFLAGS)
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
%.o: %.cpp
|
|
|
|
$(HOSTCXX) -c $< -o $@ $(CPPFLAGS) $(FLAGS) $(CXXFLAGS)
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2012-02-11 20:03:34 -05:00
|
|
|
%.o: %.s
|
2012-09-10 17:36:15 -04:00
|
|
|
$(HOSTAS) $(ASFLAGS) $< -o $@
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2012-09-23 08:04:53 -04:00
|
|
|
# libc-sortix
|
2013-03-19 18:28:32 -04:00
|
|
|
sortix/%.o: %.c
|
|
|
|
$(HOSTCC) -c $< -o $@ $(SORTIXCPPFLAGS) $(SORTIXFLAGS) $(SORTIXCFLAGS)
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2013-03-19 18:28:32 -04:00
|
|
|
sortix/%.o: %.cpp
|
|
|
|
$(HOSTCXX) -c $< -o $@ $(SORTIXCPPFLAGS) $(SORTIXFLAGS) $(SORTIXCXXFLAGS)
|
2011-08-05 08:25:00 -04:00
|
|
|
|
|
|
|
clean:
|
2013-03-19 18:28:32 -04:00
|
|
|
rm -f $(wildcard *.o) $(wildcard */*.o) $(wildcard */*/*.o) $(wildcard *.a)
|
|
|
|
rm -rf $(HEADERDIRS)
|
2011-08-05 08:25:00 -04:00
|
|
|
|
2011-09-15 16:38:40 -04:00
|
|
|
# Installation into sysroot
|
2013-03-19 18:28:32 -04:00
|
|
|
install: install-headers install-libs install-libs-kernel
|
|
|
|
|
|
|
|
$(INSTALLHEADERDIRS) $(DESTDIR)$(LIBDIR):
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
$(DESTDIR)$(INCLUDEDIR)/%: preproc/%
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
$(INSTALLHEADERS): | $(INSTALLHEADERDIRS)
|
|
|
|
|
|
|
|
$(DESTDIR)$(LIBDIR)/%: %
|
|
|
|
cp -P $< $@
|
|
|
|
|
|
|
|
$(INSTALLLIBS): | $(DESTDIR)$(LIBDIR)
|
|
|
|
|
|
|
|
$(INSTALLLIBSKERNEL): | $(DESTDIR)$(LIBDIR)
|
|
|
|
|
|
|
|
$(DESTDIR)$(INCLUDEDIR) $(DESTDIR)$(LIBDIR) $(INSTALLHEADERS): FORCE
|
|
|
|
|
|
|
|
install-include-dirs: $(INSTALLHEADERDIRS)
|
|
|
|
|
|
|
|
install-headers: $(INSTALLHEADERDIRS) $(INSTALLHEADERS)
|
|
|
|
|
|
|
|
install-lib-dirs: $(DESTDIR)$(LIBDIR)
|
|
|
|
|
|
|
|
install-libs: $(INSTALLLIBS)
|
|
|
|
|
|
|
|
install-libs-kernel: $(INSTALLLIBSKERNEL)
|
2011-09-15 16:38:40 -04:00
|
|
|
|