Changes in uspace/lib/posix/Makefile [2660ee3:3a37751] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/Makefile
r2660ee3 r3a37751 37 37 LIBC_FILE = $(LIBC_PREFIX)/libc.a 38 38 39 FIXED_POSIX_LIBRARY = libposixaslibc.a 39 40 FIXED_C_LIBRARY = libc4posix.a 40 41 MERGED_C_LIBRARY = libc.a 41 42 MERGE_LIBRARIES = \ 42 43 $(FIXED_C_LIBRARY) \ 43 $( LIBRARY).a\44 $(FIXED_POSIX_LIBRARY) \ 44 45 $(LIBSOFTFLOAT_PREFIX)/libsoftfloat.a \ 45 46 $(LIBSOFTINT_PREFIX)/libsoftint.a 46 47 47 SPECS = gcc.specs48 LIBC_LINKER_SCRIPT = $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld49 LIBC_STARTUP_FILE = $(shell sed -n -e 's/^.*STARTUP(\(.*\)).*$$/\1/p' $(LIBC_LINKER_SCRIPT))50 EXPORT_LINKER_SCRIPT = link.ld51 EXPORT_STARTUP_FILE = crt0.o52 53 EXPORT_FILES = \54 ../math/libmath.a \55 ../clui/libclui.a \56 $(MERGED_C_LIBRARY) \57 $(EXPORT_STARTUP_FILE) \58 $(EXPORT_LINKER_SCRIPT) \59 $(SPECS)60 61 48 REDEFS_HIDE_LIBC = redefs-hide-libc-symbols.list 49 REDEFS_SHOW_LIBPOSIX = redefs-show-posix-symbols.list 50 COLLISIONS_LIST = collisions.list 62 51 63 52 PRE_DEPEND = $(INCLUDE_LIBC) … … 65 54 $(INCLUDE_LIBC) \ 66 55 $(REDEFS_HIDE_LIBC) \ 56 $(REDEFS_SHOW_LIBPOSIX) \ 57 $(COLLISIONS_LIST) \ 67 58 libc.o 68 59 69 EXTRA_OUTPUT = $(FIXED_C_LIBRARY) $(FIXED_POSIX_LIBRARY) $(MERGED_C_LIBRARY) $(SPECS) $(EXPORT_LINKER_SCRIPT) $(EXPORT_STARTUP_FILE)60 EXTRA_OUTPUT = $(FIXED_C_LIBRARY) $(FIXED_POSIX_LIBRARY) $(MERGED_C_LIBRARY) 70 61 71 62 SOURCES = \ 72 src/ctype.c \ 73 src/dlfcn.c \ 74 src/fcntl.c \ 75 src/fnmatch.c \ 76 src/locale.c \ 77 src/pthread/condvar.c \ 78 src/pthread/keys.c \ 79 src/pthread/mutex.c \ 80 src/pthread/threads.c \ 81 src/pwd.c \ 82 src/signal.c \ 83 src/stdio.c \ 84 src/stdio/scanf.c \ 85 src/stdlib.c \ 86 src/stdlib/strtold.c \ 87 src/string.c \ 88 src/strings.c \ 89 src/sys/mman.c \ 90 src/sys/stat.c \ 91 src/sys/wait.c \ 92 src/time.c \ 93 src/unistd.c 63 source/ctype.c \ 64 source/dlfcn.c \ 65 source/errno.c \ 66 source/fcntl.c \ 67 source/fnmatch.c \ 68 source/getopt.c \ 69 source/locale.c \ 70 source/pthread/condvar.c \ 71 source/pthread/keys.c \ 72 source/pthread/mutex.c \ 73 source/pthread/threads.c \ 74 source/pwd.c \ 75 source/signal.c \ 76 source/stdio.c \ 77 source/stdio/scanf.c \ 78 source/stdlib.c \ 79 source/stdlib/strtol.c \ 80 source/stdlib/strtold.c \ 81 source/string.c \ 82 source/strings.c \ 83 source/sys/mman.c \ 84 source/sys/stat.c \ 85 source/sys/wait.c \ 86 source/time.c \ 87 source/unistd.c 94 88 95 89 TEST_SOURCES = \ … … 97 91 test/scanf.c 98 92 99 EXPORT_CPPFLAGS = \100 -specs $$(HELENOS_EXPORT_ROOT)/lib/gcc.specs \101 -isystem $$(HELENOS_EXPORT_ROOT)/include102 103 EXPORT_LDFLAGS = \104 -L$$(HELENOS_EXPORT_ROOT)/lib \105 --whole-archive -lc -lmath --no-whole-archive \106 -T link.ld107 108 EXPORT_CFLAGS = \109 $(EXPORT_CPPFLAGS) \110 $(addprefix -Xlinker , $(EXPORT_LDFLAGS))111 112 93 include $(USPACE_PREFIX)/Makefile.common 113 94 114 $(SPECS): $(CONFIG_MAKEFILE) 115 echo '*self_spec:' > $@.new 116 echo '+ $(COMMON_CFLAGS)' >> $@.new 117 echo >> $@.new 118 echo '*lib:' >> $@.new 119 echo '--whole-archive -lc -lmath --no-whole-archive' >> $@.new 120 echo >> $@.new 121 mv $@.new $@ 95 $(INCLUDE_LIBC): ../c/include 96 ln -s -f -n ../$^ $@ 122 97 123 $(EXPORT_LINKER_SCRIPT): $(LIBC_LINKER_SCRIPT) 124 sed 's/STARTUP(.*)/STARTUP(crt0.o)/' $< > $@ 98 $(FIXED_C_LIBRARY): $(LIBC_FILE) $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX) 99 $(OBJCOPY) --redefine-syms=$(REDEFS_HIDE_LIBC) $(LIBC_FILE) $@ 100 $(OBJCOPY) --redefine-syms=$(REDEFS_SHOW_LIBPOSIX) $@ $@ 125 101 126 $(EXPORT_STARTUP_FILE): $(LIBC_STARTUP_FILE) 127 cp $< $@ 128 129 $(INCLUDE_LIBC): $(shell find ../c/include -name '*.h') 130 cp -r -L --remove-destination -T ../c/include $@ 131 find ../c/include -type f -and -not -name '*.h' -delete 132 133 export: $(EXPORT_DIR)/config.mk $(EXPORT_DIR)/config.rc 134 135 $(EXPORT_DIR)/config.mk: export-libs export-includes 136 echo '# Generated file, do not modify.' >> $@.new 137 echo '# Do not forget to set HELENOS_EXPORT_ROOT.' >> $@.new 138 echo 'HELENOS_CROSS_PATH="$(shell dirname $(CC))"' >> $@.new 139 echo 'HELENOS_TARGET="$(TARGET)"' >> $@.new 140 echo 'HELENOS_CPPFLAGS="$(EXPORT_CPPFLAGS)"' >> $@.new 141 echo 'HELENOS_CFLAGS="$(EXPORT_CFLAGS)"' >> $@.new 142 echo 'HELENOS_LDFLAGS="$(EXPORT_LDFLAGS)"' >> $@.new 143 mv $@.new $@ 144 145 $(EXPORT_DIR)/config.rc: $(EXPORT_DIR)/config.mk 146 sed 's:$$(HELENOS_EXPORT_ROOT):$$HELENOS_EXPORT_ROOT:g' < $< >$@ 147 148 export-libs: $(EXPORT_FILES) export-includes 149 mkdir -p $(EXPORT_DIR)/lib 150 cp -L $(EXPORT_FILES) $(EXPORT_DIR)/lib 151 152 export-includes: $(INCLUDE_LIBC) $(shell find ./include ../c/arch/$(UARCH)/include $(ROOT_PATH)/abi/include -name '*.h') 153 mkdir -p $(EXPORT_DIR)/include 154 rm -rf $(EXPORT_DIR)/include.new 155 cp -r -L -T ./include/posix $(EXPORT_DIR)/include.new 156 cp -r -L -T ./include/libc $(EXPORT_DIR)/include.new/libc 157 cp -r -L ../c/arch/$(UARCH)/include/* $(EXPORT_DIR)/include.new/libc 158 cp -r -L $(ROOT_PATH)/abi/include/* $(EXPORT_DIR)/include.new 159 mkdir -p $(EXPORT_DIR)/include.new/libclui 160 cp -L ../clui/tinput.h $(EXPORT_DIR)/include.new/libclui 161 162 find "$(EXPORT_DIR)/include.new/libc" "$(EXPORT_DIR)/include.new/libclui" -name '*.h' -exec sed \ 163 -e 's:#include <:#include <libc/:' \ 164 -e 's:#include <libc/abi/:#include <abi/:' \ 165 -e 's:#include <libc/_bits/:#include <_bits/:' \ 166 -e 's:#include <libc/libc/:#include <libc/:' \ 167 -i {} \; 168 find "$(EXPORT_DIR)/include.new" -name '*.h' -exec sed \ 169 -e 's:#include "posix/:#include ":' \ 170 -e 's:#include <posix/:#include <:' \ 171 -i {} \; 172 173 rm -rf $(EXPORT_DIR)/include 174 mv $(EXPORT_DIR)/include.new $(EXPORT_DIR)/include 175 176 $(FIXED_C_LIBRARY): $(LIBC_FILE) $(REDEFS_HIDE_LIBC) 177 $(OBJCOPY) --redefine-syms=$(REDEFS_HIDE_LIBC) $(LIBC_FILE) $@ 102 $(FIXED_POSIX_LIBRARY): $(LIBRARY).a $(REDEFS_HIDE_LIBC) $(REDEFS_SHOW_LIBPOSIX) 103 $(OBJCOPY) --redefine-syms=$(REDEFS_HIDE_LIBC) $(LIBRARY).a $@ 104 $(OBJCOPY) --redefine-syms=$(REDEFS_SHOW_LIBPOSIX) $@ $@ 178 105 179 106 $(MERGED_C_LIBRARY): $(MERGE_LIBRARIES) … … 181 108 $(AR) rc $@ libc.o 182 109 183 $(REDEFS_HIDE_LIBC): $(SOURCES) 184 sed -n -e 's/_HIDE_LIBC_SYMBOL(\(.*\))/\1 __helenos_libc_\1/p' $(SOURCES) >$@ 110 $(REDEFS_HIDE_LIBC): $(COLLISIONS_LIST) 111 sed 's/.*/& __helenos_libc_&/' <$(COLLISIONS_LIST) >$@ 112 113 $(REDEFS_SHOW_LIBPOSIX): $(COLLISIONS_LIST) 114 sed 's/.*/posix_& &/' <$(COLLISIONS_LIST) >$@ 115 116 $(COLLISIONS_LIST): include/posix/*.h include/posix/*/*.h 117 find ./include/posix -name '*.h' -exec \ 118 sed -n -e '/^#/d' -e 's/__POSIX_DEF__/\n&/gp' {} \; | \ 119 sed -n -e 's/__POSIX_DEF__(\([^)]*\)).*/\1/p' | \ 120 sort -u >$@
Note:
See TracChangeset
for help on using the changeset viewer.