[254b4450] | 1 | # |
---|
| 2 | # $Id$ |
---|
| 3 | # |
---|
| 4 | |
---|
| 5 | @SET_MAKE@ |
---|
| 6 | srcdir = @srcdir@ |
---|
[d8ff793] | 7 | top_srcdir = @top_srcdir@ |
---|
| 8 | top_builddir = ../../../.. |
---|
| 9 | subdir = c/src/lib/libc |
---|
[254b4450] | 10 | |
---|
[8548fe0] | 11 | INSTALL = @INSTALL@ |
---|
| 12 | |
---|
[d8ff793] | 13 | RTEMS_ROOT = $(top_srcdir)/@RTEMS_TOPdir@ |
---|
| 14 | PROJECT_ROOT = @PROJECT_ROOT@ |
---|
| 15 | |
---|
| 16 | VPATH = @srcdir@ |
---|
| 17 | |
---|
[254b4450] | 18 | LIBNAME=libcsupport.a |
---|
| 19 | LIB=${ARCH}/${LIBNAME} |
---|
| 20 | |
---|
[07a3253d] | 21 | BASE_FS_PIECES=base_fs mount unmount ioman \ |
---|
[d78b7a9e] | 22 | libio libio_sockets eval |
---|
[07a3253d] | 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 \ |
---|
[af73d86f] | 28 | imfs_readlink imfs_fdatasync |
---|
[07a3253d] | 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=\ |
---|
[3165b4d3] | 43 | opendir closedir readdir rewinddir scandir seekdir telldir getcwd |
---|
[07a3253d] | 44 | |
---|
[af73d86f] | 45 | MALLOC_PIECES=\ |
---|
[07a3253d] | 46 | malloc __brk __sbrk \ |
---|
[af73d86f] | 47 | |
---|
| 48 | LIBC_GLUE_PIECES=\ |
---|
[07a3253d] | 49 | __gettod __times \ |
---|
[933388ae] | 50 | truncate access stat lstat pathconf \ |
---|
[af73d86f] | 51 | newlibc no_libc |
---|
[fbd5320] | 52 | |
---|
[af73d86f] | 53 | UNIX_LIBC_PIECES=unixlibc hosterr |
---|
[07a3253d] | 54 | |
---|
[254b4450] | 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 | |
---|
[07a3253d] | 62 | SRCS=$(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) |
---|
[254b4450] | 63 | OBJS=$(C_O_FILES) |
---|
| 64 | |
---|
[196094eb] | 65 | include $(RTEMS_ROOT)/make/custom/${RTEMS_BSP}.cfg |
---|
[4dc0fd6] | 66 | include $(RTEMS_ROOT)/make/lib.cfg |
---|
[254b4450] | 67 | |
---|
[af73d86f] | 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 | |
---|
[254b4450] | 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. |
---|
[8548fe0] | 111 | # for include files, just use $(INSTALL_CHANGE) |
---|
[254b4450] | 112 | preinstall: |
---|
[8548fe0] | 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 |
---|
[d8ff793] | 116 | |
---|
| 117 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status |
---|
| 118 | cd $(top_builddir) \ |
---|
| 119 | && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status |
---|