Changes in uspace/Makefile.common [afdcc60e:79ae36dd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/Makefile.common
rafdcc60e r79ae36dd 40 40 # BINARY (/) binary output name (like appname) 41 41 # LIBRARY (/) library output name (like libname) 42 # 42 43 # EXTRA_OUTPUT additional output targets 43 44 # EXTRA_CLEAN additional cleanup targets 45 # 46 # Optionally, for a binary: 47 # STATIC_NEEDED set to 'y' for init binaries, will build statically 48 # linked version 49 # STATIC_ONLY set to 'y' if binary cannot be linked dynamically 50 # (e.g. uses thread-local variables) 51 # 52 # Optionally, for a libary: 53 # SLIBRARY Name with full version, e.g. libfoo.so.0.0 54 # LSONAME Soname / name with short version, e.g. libfoo.so.0 44 55 # 45 56 # (x) required variables … … 73 84 endif 74 85 86 ifeq ($(CONFIG_BUILD_SHARED_LIBS), y) 87 ifneq ($(SLIBRARY),) 88 LARCHIVE = $(LIBRARY).la 89 LOUTPUT = $(SLIBRARY) 90 EXTRA_OUTPUT += $(LOUTPUT).disasm $(LIBRARY).so $(LSONAME) 91 EXTRA_CLEAN += $(LOUTPUT).map $(LOUTPUT).ldisasm \ 92 $(LIBC_PREFIX)/shared/arch/$(UARCH)/_lib.ld \ 93 $(LIBRARY).so $(LSONAME) 94 endif 95 endif 96 75 97 DEPEND = Makefile.depend 76 98 DEPEND_PREV = $(DEPEND).prev … … 86 108 LIBCLUI_PREFIX = $(LIB_PREFIX)/clui 87 109 110 LIBEXT2_PREFIX = $(LIB_PREFIX)/ext2 111 112 LIBUSB_PREFIX = $(LIB_PREFIX)/usb 113 LIBUSBHOST_PREFIX = $(LIB_PREFIX)/usbhost 114 LIBUSBDEV_PREFIX = $(LIB_PREFIX)/usbdev 115 LIBUSBHID_PREFIX = $(LIB_PREFIX)/usbhid 116 LIBUSBVIRT_PREFIX = $(LIB_PREFIX)/usbvirt 117 88 118 LIBDRV_PREFIX = $(LIB_PREFIX)/drv 89 119 LIBPACKET_PREFIX = $(LIB_PREFIX)/packet 90 120 LIBNET_PREFIX = $(LIB_PREFIX)/net 91 121 122 ifeq ($(STATIC_NEEDED),y) 123 STATIC_BUILD = y 124 else 125 ifeq ($(STATIC_ONLY),y) 126 STATIC_BUILD = y 127 else 128 ifeq ($(CONFIG_USE_SHARED_LIBS), y) 129 STATIC_BUILD = n 130 else 131 STATIC_BUILD = y 132 endif 133 endif 134 endif 135 136 # Build static whenever we use libusb because that library uses 137 # thread local variables 138 ifneq ($(findstring usb, $(LIBS)),) 139 STATIC_BUILD = y 140 endif 141 142 ifeq ($(STATIC_BUILD), y) 92 143 BASE_LIBS = $(LIBC_PREFIX)/libc.a $(LIBSOFTINT_PREFIX)/libsoftint.a 93 94 144 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld 145 else 146 BASE_LIBS = $(LIBC_PREFIX)/libc.so0 $(LIBSOFTINT_PREFIX)/libsofti.so0 147 LFLAGS = -Bdynamic 148 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld 149 endif 95 150 96 151 ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y) … … 102 157 .PHONY: all clean 103 158 104 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(LIBS) $(OUTPUT) $( EXTRA_OUTPUT)159 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(LIBS) $(OUTPUT) $(LOUTPUT) $(EXTRA_OUTPUT) 105 160 -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV) 106 161 107 162 clean: 108 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $( EXTRA_OUTPUT) $(EXTRA_CLEAN)163 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(LARCHIVE) $(LOUTPUT) $(EXTRA_OUTPUT) $(EXTRA_CLEAN) 109 164 find . -name '*.o' -follow -exec rm \{\} \; 165 find . -name '*.lo' -follow -exec rm \{\} \; 110 166 111 167 GCC_CFLAGS = -I$(LIBC_PREFIX)/include -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ … … 113 169 -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \ 114 170 -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \ 115 - Werror-implicit-function-declaration -Wwrite-strings \171 -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \ 116 172 -pipe -g -D__$(ENDIANESS)__ 117 173 … … 130 186 -pipe -g -arch $(CLANG_ARCH) -D__$(ENDIANESS)__ 131 187 188 LIB_CFLAGS = $(CFLAGS) -fPIC -D__IN_SHARED_LIBC__ 189 LIB_LFLAGS = $(LFLAGS) -shared -soname $(LSONAME) --whole-archive 190 132 191 ifeq ($(CONFIG_DEBUG),y) 133 192 GCC_CFLAGS += -Werror … … 175 234 176 235 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) 236 LOBJECTS := $(addsuffix .lo,$(basename $(SOURCES))) 177 237 178 238 ifneq ($(BINARY),) … … 191 251 endif 192 252 253 ifneq ($(SLIBRARY),) 254 %.disasm: $(LOUTPUT) 255 ifeq ($(CONFIG_LINE_DEBUG),y) 256 $(OBJDUMP) -d -S $< > $@ 257 else 258 $(OBJDUMP) -d $< > $@ 259 endif 260 261 $(LOUTPUT): $(LARCHIVE) $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld 262 $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld $(LIB_LFLAGS) $(LARCHIVE) -o $@ -Map $(LOUTPUT).map 263 264 $(LIBRARY).so: 265 ln -s $(SLIBRARY) $@ 266 267 $(LSONAME): 268 ln -s $(SLIBRARY) $@ 269 endif 270 193 271 ifneq ($(LIBRARY),) 194 272 %.a: $(OBJECTS) … … 196 274 endif 197 275 276 ifneq ($(SLIBRARY),) 277 %.la: $(LOBJECTS) 278 $(AR) rc $@ $(LOBJECTS) 279 endif 280 198 281 %.o: %.S $(DEPEND) 199 282 $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -c $< -o $@ … … 210 293 %.o: %.c $(DEPEND) 211 294 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ 295 ifeq ($(PRECHECK),y) 296 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) 297 endif 298 299 %.lo: %.S $(DEPEND) 300 $(CC) $(DEFS) $(LIB_CFLAGS) -D__ASM__ -c $< -o $@ 301 ifeq ($(PRECHECK),y) 302 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__ 303 endif 304 305 %.lo: %.s $(DEPEND) 306 $(AS) $(AFLAGS) -o $@ $< 307 ifeq ($(PRECHECK),y) 308 $(JOBFILE) $(JOB) $< $@ as asm 309 endif 310 311 %.lo: %.c $(DEPEND) 312 $(CC) $(DEFS) $(LIB_CFLAGS) -c $< -o $@ 212 313 ifeq ($(PRECHECK),y) 213 314 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) … … 223 324 $(OUTPUT): $(OBJECTS) 224 325 326 $(LARCHIVE): $(LOBJECTS)
Note:
See TracChangeset
for help on using the changeset viewer.