1 | # |
---|
2 | # $Id$ |
---|
3 | # |
---|
4 | |
---|
5 | @SET_MAKE@ |
---|
6 | srcdir = @srcdir@ |
---|
7 | top_srcdir = @top_srcdir@ |
---|
8 | top_builddir = .. |
---|
9 | subdir = libc |
---|
10 | |
---|
11 | RTEMS_ROOT = @RTEMS_ROOT@ |
---|
12 | PROJECT_ROOT = @PROJECT_ROOT@ |
---|
13 | |
---|
14 | VPATH = @srcdir@ |
---|
15 | |
---|
16 | LIBNAME = libcsupport.a |
---|
17 | LIB = ${ARCH}/${LIBNAME} |
---|
18 | |
---|
19 | ERROR_C_PIECES=error |
---|
20 | |
---|
21 | ASSOCIATION_C_PIECES=assoc assocnamebad |
---|
22 | |
---|
23 | BASE_FS_C_PIECES = base_fs mount unmount ioman libio libio_sockets eval \ |
---|
24 | fs_null_handlers |
---|
25 | |
---|
26 | IMFS_C_PIECES = imfs_chown imfs_creat imfs_directory imfs_eval imfs_free \ |
---|
27 | imfs_fsunmount imfs_gtkn imfs_init imfs_initsupp imfs_link imfs_mknod \ |
---|
28 | imfs_mount imfs_fchmod imfs_unlink imfs_unmount imfs_utime \ |
---|
29 | imfs_ntype imfs_stat imfs_getchild memfile deviceio imfs_handlers_device \ |
---|
30 | imfs_handlers_directory imfs_handlers_link imfs_handlers_memfile \ |
---|
31 | imfs_debug imfs_rmnod imfs_symlink imfs_readlink imfs_fdatasync \ |
---|
32 | imfs_fcntl miniimfs_init |
---|
33 | |
---|
34 | TERMIOS_C_PIECES = cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcgetattr \ |
---|
35 | tcsetattr tcdrain tcflow tcflush tcgetprgrp tcsendbreak tcsetpgrp \ |
---|
36 | termios termiosinitialize termiosreserveresources |
---|
37 | |
---|
38 | SYSTEM_CALL_C_PIECES = open close read write lseek ioctl mkdir mknod mkfifo \ |
---|
39 | rmdir chdir chmod fchmod chown link unlink umask ftruncate utime fstat \ |
---|
40 | fcntl fpathconf getdents fsync fdatasync pipe dup dup2 symlink readlink \ |
---|
41 | creat |
---|
42 | |
---|
43 | DIRECTORY_SCAN_C_PIECES = opendir closedir readdir rewinddir scandir seekdir \ |
---|
44 | telldir getcwd |
---|
45 | |
---|
46 | MALLOC_C_PIECES = malloc __brk __sbrk |
---|
47 | |
---|
48 | PASSWORD_GROUP_C_PIECES = getpwent getgrent |
---|
49 | |
---|
50 | TERMINAL_IDENTIFICATION = ctermid isatty ttyname ttyname_r |
---|
51 | |
---|
52 | LIBC_GLUE_C_PIECES = __getpid __gettod __times truncate access stat \ |
---|
53 | lstat pathconf newlibc no_posix no_libc |
---|
54 | |
---|
55 | UNIX_LIBC_C_PIECES = unixlibc hosterr |
---|
56 | |
---|
57 | # C and C++ source names, if any, go here -- minus the .c or .cc |
---|
58 | UNIX_C_PIECES = $(UNIX_LIBC_C_PIECES) $(BASE_FS_C_PIECES) $(MALLOC_C_PIECES) \ |
---|
59 | $(TERMIOS_C_PIECES) $(ERROR_C_PIECES) $(ASSOCIATION_C_PIECES) \ |
---|
60 | imfs_unixstub |
---|
61 | |
---|
62 | EMBEDDED_C_PIECES = $(LIBC_GLUE_C_PIECES) $(BASE_FS_C_PIECES) \ |
---|
63 | $(MALLOC_C_PIECES) $(PASSWORD_GROUP_C_PIECES) $(TERMINAL_IDENTIFICATION) \ |
---|
64 | $(TERMIOS_C_PIECES) $(SYSTEM_CALL_C_PIECES) $(DIRECTORY_SCAN_C_PIECES) \ |
---|
65 | $(IMFS_C_PIECES) $(ERROR_C_PIECES) $(ASSOCIATION_C_PIECES) |
---|
66 | |
---|
67 | |
---|
68 | @UNIX_TRUE@C_PIECES = $(UNIX_C_PIECES) |
---|
69 | @UNIX_FALSE@C_PIECES = $(EMBEDDED_C_PIECES) |
---|
70 | C_FILES = $(C_PIECES:%=%.c) |
---|
71 | C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) |
---|
72 | |
---|
73 | H_FILES = $(srcdir)/libcsupport.h $(srcdir)/imfs.h |
---|
74 | SYS_H_FILES = |
---|
75 | RTEMS_H_FILES = $(srcdir)/assoc.h $(srcdir)/error.h $(srcdir)/libio.h |
---|
76 | |
---|
77 | include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg |
---|
78 | include $(RTEMS_ROOT)/make/lib.cfg |
---|
79 | |
---|
80 | INSTALL_CHANGE = @INSTALL_CHANGE@ |
---|
81 | mkinstalldirs = $(SHELL) $(top_srcdir)/@RTEMS_TOPdir@/mkinstalldirs |
---|
82 | |
---|
83 | INSTALLDIRS = $(PROJECT_INCLUDE)/rtems $(PROJECT_INCLUDE)/sys \ |
---|
84 | $(PROJECT_INCLUDE) |
---|
85 | |
---|
86 | $(INSTALLDIRS): |
---|
87 | @$(mkinstalldirs) $(INSTALLDIRS) |
---|
88 | |
---|
89 | SRCS = $(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) |
---|
90 | OBJS = $(C_O_FILES) |
---|
91 | |
---|
92 | # |
---|
93 | # Add local stuff here using += |
---|
94 | # |
---|
95 | |
---|
96 | DEFINES += |
---|
97 | CPPFLAGS += |
---|
98 | CFLAGS += $(LIBC_DEFINES) |
---|
99 | |
---|
100 | # |
---|
101 | # Add your list of files to delete here. The config files |
---|
102 | # already know how to delete some stuff, so you may want |
---|
103 | # to just run 'make clean' first to see what gets missed. |
---|
104 | # 'make clobber' already includes 'make clean' |
---|
105 | # |
---|
106 | |
---|
107 | CLEAN_ADDITIONS += $(LIB) |
---|
108 | CLOBBER_ADDITIONS += |
---|
109 | |
---|
110 | all: ${ARCH} preinstall $(LIB) |
---|
111 | @$(INSTALL_VARIANT) -m 644 ${LIB} $(PROJECT_RELEASE)/lib |
---|
112 | |
---|
113 | $(LIB): $(SRCS) ${OBJS} |
---|
114 | $(make-library) |
---|
115 | |
---|
116 | # Install the library, appending _g or _p as appropriate. |
---|
117 | # for include files, just use $(INSTALL_CHANGE) |
---|
118 | preinstall: |
---|
119 | @$(mkinstalldirs) $(INSTALLDIRS) |
---|
120 | @$(INSTALL_CHANGE) -m 644 $(RTEMS_H_FILES) $(PROJECT_INCLUDE)/rtems |
---|
121 | @$(INSTALL_CHANGE) -m 644 $(H_FILES) $(PROJECT_INCLUDE) |
---|
122 | @$(INSTALL_CHANGE) -m 644 $(SYS_H_FILES) $(PROJECT_INCLUDE)/sys |
---|
123 | |
---|
124 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
---|
125 | cd $(top_builddir) \ |
---|
126 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status |
---|