Changes in uspace/Makefile.common [0feaae4:664af708] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/Makefile.common
r0feaae4 r664af708 40 40 # BINARY (/) binary output name (like appname) 41 41 # LIBRARY (/) library output name (like libname) 42 #43 42 # EXTRA_OUTPUT additional output targets 44 43 # EXTRA_CLEAN additional cleanup targets 45 #46 # Optionally, for a binary:47 # STATIC_NEEDED set to 'y' for init binaries, will build statically48 # linked version49 # STATIC_ONLY set to 'y' if binary cannot be linked dynamically50 # (e.g. uses thread-local variables)51 #52 # Optionally, for a libary:53 # SLIBRARY Name with full version, e.g. libfoo.so.0.054 # LSONAME Soname / name with short version, e.g. libfoo.so.055 44 # 56 45 # (x) required variables … … 84 73 endif 85 74 86 ifeq ($(CONFIG_BUILD_SHARED_LIBS), y)87 ifneq ($(SLIBRARY),)88 LARCHIVE = $(LIBRARY).la89 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 endif95 endif96 97 75 DEPEND = Makefile.depend 98 76 DEPEND_PREV = $(DEPEND).prev … … 108 86 LIBCLUI_PREFIX = $(LIB_PREFIX)/clui 109 87 110 LIBEXT2_PREFIX = $(LIB_PREFIX)/ext2111 112 LIBUSB_PREFIX = $(LIB_PREFIX)/usb113 LIBUSBHOST_PREFIX = $(LIB_PREFIX)/usbhost114 LIBUSBDEV_PREFIX = $(LIB_PREFIX)/usbdev115 LIBUSBHID_PREFIX = $(LIB_PREFIX)/usbhid116 LIBUSBVIRT_PREFIX = $(LIB_PREFIX)/usbvirt117 118 88 LIBDRV_PREFIX = $(LIB_PREFIX)/drv 119 89 LIBPACKET_PREFIX = $(LIB_PREFIX)/packet 120 90 LIBNET_PREFIX = $(LIB_PREFIX)/net 121 91 122 LIBSCSI_PREFIX = $(LIB_PREFIX)/scsi123 124 ifeq ($(STATIC_NEEDED),y)125 STATIC_BUILD = y126 else127 ifeq ($(STATIC_ONLY),y)128 STATIC_BUILD = y129 else130 ifeq ($(CONFIG_USE_SHARED_LIBS), y)131 STATIC_BUILD = n132 else133 STATIC_BUILD = y134 endif135 endif136 endif137 138 # Build static whenever we use libusb because that library uses139 # thread local variables140 ifneq ($(findstring usb, $(LIBS)),)141 STATIC_BUILD = y142 endif143 144 ifeq ($(STATIC_BUILD), y)145 92 BASE_LIBS = $(LIBC_PREFIX)/libc.a $(LIBSOFTINT_PREFIX)/libsoftint.a 93 146 94 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld 147 else148 BASE_LIBS = $(LIBC_PREFIX)/libc.so0 $(LIBSOFTINT_PREFIX)/libsofti.so0149 LFLAGS = -Bdynamic150 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld151 endif152 95 153 96 ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y) … … 159 102 .PHONY: all clean 160 103 161 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(LIBS) $(OUTPUT) $( LOUTPUT) $(EXTRA_OUTPUT)104 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(LIBS) $(OUTPUT) $(EXTRA_OUTPUT) 162 105 -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV) 163 106 164 107 clean: 165 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $( LARCHIVE) $(LOUTPUT) $(EXTRA_OUTPUT) $(EXTRA_CLEAN)108 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(EXTRA_OUTPUT) $(EXTRA_CLEAN) 166 109 find . -name '*.o' -follow -exec rm \{\} \; 167 find . -name '*.lo' -follow -exec rm \{\} \;168 110 169 111 GCC_CFLAGS = -I$(LIBC_PREFIX)/include -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ … … 171 113 -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \ 172 114 -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \ 173 - std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \115 -Werror-implicit-function-declaration -Wwrite-strings \ 174 116 -pipe -g -D__$(ENDIANESS)__ 175 117 … … 188 130 -pipe -g -arch $(CLANG_ARCH) -D__$(ENDIANESS)__ 189 131 190 LIB_CFLAGS = $(CFLAGS) -fPIC -D__IN_SHARED_LIBC__191 LIB_LFLAGS = $(LFLAGS) -shared -soname $(LSONAME) --whole-archive192 193 132 ifeq ($(CONFIG_DEBUG),y) 194 133 GCC_CFLAGS += -Werror … … 236 175 237 176 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) 238 LOBJECTS := $(addsuffix .lo,$(basename $(SOURCES)))239 177 240 178 ifneq ($(BINARY),) … … 247 185 248 186 $(BINARY): $(LINKER_SCRIPT) $(OBJECTS) $(LIBS) $(BASE_LIBS) 249 $(LD) - n$(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(BINARY).map -o $(BINARY) $(OBJECTS) $(LIBS) $(BASE_LIBS)187 $(LD) -N $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(BINARY).map -o $(BINARY) $(OBJECTS) $(LIBS) $(BASE_LIBS) 250 188 ifeq ($(CONFIG_STRIP_BINARIES),y) 251 189 $(STRIP) $(BINARY) 252 190 endif 253 endif254 255 ifneq ($(SLIBRARY),)256 %.disasm: $(LOUTPUT)257 ifeq ($(CONFIG_LINE_DEBUG),y)258 $(OBJDUMP) -d -S $< > $@259 else260 $(OBJDUMP) -d $< > $@261 endif262 263 $(LOUTPUT): $(LARCHIVE) $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld264 $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld $(LIB_LFLAGS) $(LARCHIVE) -o $@ -Map $(LOUTPUT).map265 266 $(LIBRARY).so:267 ln -s $(SLIBRARY) $@268 269 $(LSONAME):270 ln -s $(SLIBRARY) $@271 191 endif 272 192 … … 274 194 %.a: $(OBJECTS) 275 195 $(AR) rc $@ $(OBJECTS) 276 endif277 278 ifneq ($(SLIBRARY),)279 %.la: $(LOBJECTS)280 $(AR) rc $@ $(LOBJECTS)281 196 endif 282 197 … … 299 214 endif 300 215 301 %.lo: %.S $(DEPEND)302 $(CC) $(DEFS) $(LIB_CFLAGS) -D__ASM__ -c $< -o $@303 ifeq ($(PRECHECK),y)304 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__305 endif306 307 %.lo: %.s $(DEPEND)308 $(AS) $(AFLAGS) -o $@ $<309 ifeq ($(PRECHECK),y)310 $(JOBFILE) $(JOB) $< $@ as asm311 endif312 313 %.lo: %.c $(DEPEND)314 $(CC) $(DEFS) $(LIB_CFLAGS) -c $< -o $@315 ifeq ($(PRECHECK),y)316 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)317 endif318 319 216 $(DEPEND): $(PRE_DEPEND) 320 217 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null … … 326 223 $(OUTPUT): $(OBJECTS) 327 224 328 $(LARCHIVE): $(LOBJECTS)
Note:
See TracChangeset
for help on using the changeset viewer.