summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc/Makefile.in
blob: 80f63beedd966a870ae7ded5200f732abbf56179 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#
#  $Id$
#

@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ..
subdir = libc

RTEMS_ROOT = @RTEMS_ROOT@
PROJECT_ROOT = @PROJECT_ROOT@

VPATH = @srcdir@

LIBNAME = libcsupport.a
LIB = ${ARCH}/${LIBNAME}

BASE_FS_C_PIECES = base_fs mount unmount ioman libio libio_sockets eval

IMFS_C_PIECES = imfs_chown imfs_creat imfs_directory imfs_eval imfs_free \
    imfs_gtkn imfs_init imfs_link imfs_mknod imfs_mount imfs_fchmod \
    imfs_rmnod imfs_unlink imfs_unmount imfs_utime imfs_ntype imfs_stat \
    imfs_getchild memfile deviceio imfs_handlers imfs_debug imfs_symlink \
    imfs_readlink imfs_fdatasync

TERMIOS_C_PIECES = cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcgetattr \
    tcsetattr tcdrain tcflow tcflush termios \
    termiosinitialize termiosreserveresources

SYSTEM_CALL_C_PIECES = open close read write lseek ioctl mkdir mknod mkfifo \
    rmdir chdir chmod fchmod chown link unlink umask ftruncate utime fstat \
    fcntl fpathconf getdents fsync fdatasync pipe dup dup2 symlink readlink \
    creat isatty

DIRECTORY_SCAN_C_PIECES = opendir closedir readdir rewinddir scandir seekdir \
    telldir getcwd

MALLOC_C_PIECES = malloc __brk __sbrk

PASSWORD_GROUP_C_PIECES = getpwent getgrent

LIBC_GLUE_C_PIECES = __gettod __times truncate access stat lstat pathconf \
    newlibc no_libc

UNIX_LIBC_C_PIECES = unixlibc hosterr

# C and C++ source names, if any, go here -- minus the .c or .cc
UNIX_C_PIECES = $(UNIX_LIBC_C_PIECES) $(BASE_FS_C_PIECES) $(MALLOC_C_PIECES) \
    $(TERMIOS_C_PIECES)

EMBEDDED_C_PIECES = $(LIBC_GLUE_C_PIECES) $(BASE_FS_C_PIECES) \
    $(MALLOC_C_PIECES) $(PASSWORD_GROUP_C_PIECES) $(TERMIOS_C_PIECES) \
    $(SYSTEM_CALL_C_PIECES) $(DIRECTORY_SCAN_C_PIECES) $(IMFS_C_PIECES)

@UNIX_TRUE@C_PIECES = $(UNIX_C_PIECES)
@UNIX_FALSE@C_PIECES = $(EMBEDDED_C_PIECES)
C_FILES = $(C_PIECES:%=%.c)
C_O_FILES = $(C_PIECES:%=${ARCH}/%.o)

H_FILES = $(srcdir)/libcsupport.h
SYS_H_FILES =
RTEMS_H_FILES = $(srcdir)/libio.h

include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
include $(RTEMS_ROOT)/make/lib.cfg

INSTALL_CHANGE = @INSTALL_CHANGE@
mkinstalldirs = $(SHELL) $(top_srcdir)/@RTEMS_TOPdir@/mkinstalldirs

INSTALLDIRS = $(PROJECT_INCLUDE)/rtems $(PROJECT_INCLUDE)/sys \
    $(PROJECT_INCLUDE)

$(INSTALLDIRS):
	@$(mkinstalldirs) $(INSTALLDIRS)

SRCS = $(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES)
OBJS = $(C_O_FILES)

#
# Add local stuff here using +=
#

DEFINES +=
CPPFLAGS +=
CFLAGS += $(LIBC_DEFINES)

#
# Add your list of files to delete here.  The config files
#  already know how to delete some stuff, so you may want
#  to just run 'make clean' first to see what gets missed.
#  'make clobber' already includes 'make clean'
#

CLEAN_ADDITIONS += $(LIB)
CLOBBER_ADDITIONS +=

all: ${ARCH} preinstall $(LIB)
	@$(INSTALL_VARIANT) -m 644 ${LIB} $(PROJECT_RELEASE)/lib

$(LIB): $(SRCS) ${OBJS}
	$(make-library)

# Install the library, appending _g or _p as appropriate.
# for include files, just use $(INSTALL_CHANGE)
preinstall: 
	@$(mkinstalldirs) $(INSTALLDIRS)
	@$(INSTALL_CHANGE) -m 644 $(RTEMS_H_FILES) $(PROJECT_INCLUDE)/rtems
	@$(INSTALL_CHANGE) -m 644 $(H_FILES) $(PROJECT_INCLUDE)
	@$(INSTALL_CHANGE) -m 644 $(SYS_H_FILES) $(PROJECT_INCLUDE)/sys

Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	cd $(top_builddir) \
	 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status