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