1 # Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk> Makefile
4 # Copyright (C) 2000 by Lineo, inc.
6 # This program is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU Library General Public License as published by the Free
8 # Software Foundation; either version 2 of the License, or (at your option) any
11 # This program is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
16 # You should have received a copy of the GNU Library General Public License
17 # along with this program; if not, write to the Free Software Foundation, Inc.,
18 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # Derived in part from the Linux-8086 C library, the GNU C Library, and several
21 # other sundry sources. Files within this library are copyright by their
22 # respective copyright holders.
25 include $(TOPDIR)Rules.mak
28 CSRC =closedir.c dirfd.c getdents.c getdnnm.c gethstnm.c getpagesize.c \
29 isatty.c kernel_version.c mkfifo.c opendir.c readdir.c rewinddir.c \
30 seekdir.c setegid.c seteuid.c setpgrp.c statfix.c tell.c telldir.c \
31 wait.c wait3.c _xmknod.c libc_init.c tcgetatr.c
32 COBJS=$(patsubst %.c,%.o, $(CSRC))
34 NISRC= _fxstat.c _lxstat.c _xstat.c
35 NIOBJS=$(patsubst %.c,%.o, $(NISRC))
38 MOBJ=$(shell ./list_syscalls.sh)
40 OBJ=$(COBJS) $(NIOBJS) $(MOBJ)
42 UNIFIED_SYSCALL_HEADER = /dev/null
44 ifeq ($(UNIFIED_SYSCALL),true)
45 ifeq ($(TARGET_ARCH), i386)
46 UNIFIED_SYSCALL_HEADER = unified_syscall_i386.h
47 STR_SYSCALLS = str_syscalls
51 all: $(STR_SYSCALLS) unified_syscall.h $(OBJ) $(LIBC)
56 $(AR) $(ARFLAGS) $(LIBC) $(OBJ)
59 $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
60 $(STRIPTOOL) -x -R .note -R .comment $*.o
63 $(CC) $(CFLAGS) -c $< -o $@
64 $(STRIPTOOL) -x -R .note -R .comment $*.o
67 $(CC) $(CFLAGS) $< -c $*.c -o $*.o -fno-inline
68 $(STRIPTOOL) -x -R .note -R .comment $*.o
71 ./str_syscalls.sh > str_syscalls.c
72 gcc str_syscalls.c -o str_syscalls
73 ./str_syscalls > str_syscalls.h
76 cat $(UNIFIED_SYSCALL_HEADER) > unified_syscall.h
79 rm -f *.[oa] *~ core unified_syscall.h str_syscalls.[ch] str_syscalls