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=\
|
|
|
|
abort.o \
|
|
|
|
abs.o \
|
2012-09-22 08:57:20 -04:00
|
|
|
_assert.o \
|
2013-03-19 17:10:27 -04:00
|
|
|
atof.o \
|
2012-09-28 17:14:00 -04:00
|
|
|
atoi.o \
|
|
|
|
atoll.o \
|
|
|
|
atol.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
bsearch.o \
|
2012-09-26 14:02:53 -04:00
|
|
|
calloc.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
clearerr.o \
|
|
|
|
c++.o \
|
|
|
|
ctype.o \
|
2012-02-11 20:03:34 -05:00
|
|
|
dir.o \
|
2013-03-19 03:59:26 -04:00
|
|
|
div.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-28 15:06:13 -04:00
|
|
|
gmtime.o \
|
|
|
|
gmtime_r.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
heap.o \
|
2012-02-11 20:03:34 -05:00
|
|
|
integer.o \
|
2013-03-19 03:59:26 -04:00
|
|
|
ldiv.o \
|
|
|
|
lldiv.o \
|
2012-09-28 15:06:13 -04:00
|
|
|
localtime.o \
|
|
|
|
localtime_r.o \
|
2012-12-20 08:42:28 -05:00
|
|
|
mbrtowc.o \
|
2013-03-24 09:34:58 -04:00
|
|
|
mbsrtowcs.o \
|
2013-03-23 20:27:48 -04:00
|
|
|
mbstowcs.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
mbtowc.o \
|
2012-11-08 12:52:49 -05:00
|
|
|
memccpy.o \
|
2012-09-26 15:02:17 -04:00
|
|
|
memchr.o \
|
|
|
|
memcmp.o \
|
|
|
|
memcpy.o \
|
|
|
|
memmove.o \
|
|
|
|
memset.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 \
|
2012-03-05 06:37:59 -05:00
|
|
|
sort.o \
|
2012-09-23 06:32:53 -04:00
|
|
|
sprint.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
sscanf.o \
|
|
|
|
stpcpy.o \
|
2012-11-08 12:37:17 -05:00
|
|
|
stpncpy.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
strcasecmp.o \
|
|
|
|
strcat.o \
|
|
|
|
strchrnul.o \
|
|
|
|
strchr.o \
|
|
|
|
strcmp.o \
|
|
|
|
strcoll.o \
|
|
|
|
strcpy.o \
|
|
|
|
strcspn.o \
|
|
|
|
strdup.o \
|
2012-09-26 11:56:39 -04:00
|
|
|
strerror.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
strlen.o \
|
|
|
|
strncasecmp.o \
|
|
|
|
strncat.o \
|
|
|
|
strncmp.o \
|
|
|
|
strncpy.o \
|
2012-11-08 12:50:53 -05:00
|
|
|
strndup.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
strnlen.o \
|
|
|
|
strpbrk.o \
|
|
|
|
strrchr.o \
|
2012-11-08 13:56:29 -05:00
|
|
|
strsignal.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
strspn.o \
|
|
|
|
strstr.o \
|
|
|
|
strtok.o \
|
|
|
|
strtok_r.o \
|
2012-11-08 13:04:55 -05:00
|
|
|
strxfrm.o \
|
2013-03-21 20:09:03 -04:00
|
|
|
time/asctime.o \
|
|
|
|
time/asctime_r.o \
|
2013-03-22 09:14:07 -04:00
|
|
|
time/ctime.o \
|
|
|
|
time/ctime_r.o \
|
2013-01-09 10:07:27 -05:00
|
|
|
timespec.o \
|
2013-03-21 19:13:30 -04:00
|
|
|
time/strftime.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
ungetc.o \
|
|
|
|
vfscanf.o \
|
|
|
|
vsscanf.o \
|
2012-12-20 08:42:28 -05:00
|
|
|
wcrtomb.o \
|
2013-03-23 19:31:04 -04:00
|
|
|
wcscat.o \
|
2013-03-23 19:37:22 -04:00
|
|
|
wcschrnul.o \
|
|
|
|
wcschr.o \
|
2013-03-23 19:41:35 -04:00
|
|
|
wcscmp.o \
|
2013-03-23 19:25:50 -04:00
|
|
|
wcscpy.o \
|
2013-03-23 19:54:34 -04:00
|
|
|
wcscspn.o \
|
2013-03-23 19:29:31 -04:00
|
|
|
wcslen.o \
|
2013-03-23 19:43:59 -04:00
|
|
|
wcsncat.o \
|
2013-03-23 19:45:23 -04:00
|
|
|
wcsncpy.o \
|
2013-03-23 19:46:44 -04:00
|
|
|
wcsrchr.o \
|
2013-03-24 13:07:59 -04:00
|
|
|
wcsrtombs.o \
|
2013-03-23 19:52:40 -04:00
|
|
|
wcsspn.o \
|
2013-03-23 19:50:57 -04:00
|
|
|
wcstok.o \
|
2013-03-23 20:39:43 -04:00
|
|
|
wcstombs.o \
|
2012-12-20 08:42:28 -05:00
|
|
|
wctomb.o \
|
2012-12-20 10:18:24 -05:00
|
|
|
wctype.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
|
|
|
|
HOSTEDOBJS=\
|
2012-07-25 17:00:17 -04:00
|
|
|
access.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-03-29 09:57:17 -04:00
|
|
|
basename.o \
|
2013-01-06 10:49:36 -05:00
|
|
|
calltrace.o \
|
2013-03-19 12:23:41 -04:00
|
|
|
canonicalize_file_name_at.o \
|
|
|
|
canonicalize_file_name.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
chdir.o \
|
|
|
|
chmod.o \
|
2012-10-23 14:02:33 -04:00
|
|
|
chown.o \
|
2012-09-28 15:06:13 -04:00
|
|
|
clock.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
close.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-03-29 09:57:17 -04:00
|
|
|
dirname.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 \
|
2012-09-21 17:57:47 -04:00
|
|
|
env.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
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 \
|
|
|
|
_Exit.o \
|
2012-09-26 10:11:38 -04:00
|
|
|
exit.o \
|
2012-10-23 17:55:33 -04:00
|
|
|
faccessat.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 \
|
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
|
|
|
fddir-sortix.o \
|
|
|
|
fdio.o \
|
|
|
|
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-01-30 14:33:13 -05:00
|
|
|
fsm_bootstraprootfd.o \
|
|
|
|
fsm_closechannel.o \
|
|
|
|
fsm_closeserver.o \
|
|
|
|
fsm_fsbind.o \
|
|
|
|
fsm_listen.o \
|
|
|
|
fsm_mkserver.o \
|
|
|
|
fsm_recv.o \
|
|
|
|
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 \
|
2012-09-26 15:02:17 -04:00
|
|
|
getpagesize.o \
|
2012-09-26 10:11:38 -04:00
|
|
|
getpid.o \
|
|
|
|
getppid.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
gettermmode.o \
|
2012-09-28 15:06:13 -04:00
|
|
|
gettimeofday.o \
|
2013-01-12 20:37:14 -05:00
|
|
|
getuid.o \
|
2013-01-12 21:14:43 -05:00
|
|
|
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 \
|
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 \
|
|
|
|
mktemp.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-06 16:30:09 -04:00
|
|
|
on_exit.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 \
|
2012-07-25 17:00:17 -04:00
|
|
|
print.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
putc.o \
|
2013-01-08 09:09:23 -05:00
|
|
|
pwent.o \
|
2012-09-28 16:50:31 -04:00
|
|
|
raise.o \
|
2012-09-28 14:33:04 -04:00
|
|
|
rand.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-03-19 13:53:56 -04:00
|
|
|
realpath.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 \
|
|
|
|
settermmode.o \
|
2013-01-12 20:37:14 -05:00
|
|
|
setuid.o \
|
2012-09-26 10:11:38 -04:00
|
|
|
sfork.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 \
|
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-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-01-14 13:27:19 -05:00
|
|
|
system.o \
|
2012-09-26 10:11:38 -04:00
|
|
|
tfork.o \
|
2012-09-21 17:57:47 -04:00
|
|
|
time.o \
|
2013-03-29 09:29:11 -04:00
|
|
|
tmpfile.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-28 15:06:13 -04:00
|
|
|
uptime.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-09-21 17:57:47 -04:00
|
|
|
winsize.o \
|
2012-07-25 17:00:17 -04:00
|
|
|
write.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
|
|
|
|