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