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