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