Changes in uspace/Makefile.common [e8c5c11:3e4f2e0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/Makefile.common
re8c5c11 r3e4f2e0 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 88 89 LIBUSB_PREFIX = $(LIB_PREFIX)/usb 90 LIBUSBHOST_PREFIX = $(LIB_PREFIX)/usbhost 91 LIBUSBDEV_PREFIX = $(LIB_PREFIX)/usbdev 92 LIBUSBHID_PREFIX = $(LIB_PREFIX)/usbhid 93 LIBUSBVIRT_PREFIX = $(LIB_PREFIX)/usbvirt 110 94 LIBDRV_PREFIX = $(LIB_PREFIX)/drv 111 95 LIBPACKET_PREFIX = $(LIB_PREFIX)/packet 112 96 LIBNET_PREFIX = $(LIB_PREFIX)/net 113 97 114 ifeq ($(STATIC_NEEDED),y)115 STATIC_BUILD = y116 else117 ifeq ($(STATIC_ONLY),y)118 STATIC_BUILD = y119 else120 ifeq ($(CONFIG_USE_SHARED_LIBS), y)121 STATIC_BUILD = n122 else123 STATIC_BUILD = y124 endif125 endif126 endif127 128 ifeq ($(STATIC_BUILD), y)129 98 BASE_LIBS = $(LIBC_PREFIX)/libc.a $(LIBSOFTINT_PREFIX)/libsoftint.a 99 130 100 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld 131 else132 BASE_LIBS = $(LIBC_PREFIX)/libc.so0 $(LIBSOFTINT_PREFIX)/libsofti.so0133 LFLAGS = -Bdynamic134 LINKER_SCRIPT ?= $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld135 endif136 101 137 102 ifeq ($(CONFIG_OPTIMIZE_FOR_SIZE),y) … … 143 108 .PHONY: all clean 144 109 145 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(LIBS) $(OUTPUT) $( LOUTPUT) $(EXTRA_OUTPUT)110 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(LIBS) $(OUTPUT) $(EXTRA_OUTPUT) 146 111 -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV) 147 112 148 113 clean: 149 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $( LARCHIVE) $(LOUTPUT) $(EXTRA_OUTPUT) $(EXTRA_CLEAN)114 rm -f $(DEPEND) $(DEPEND_PREV) $(JOB) $(OUTPUT) $(EXTRA_OUTPUT) $(EXTRA_CLEAN) 150 115 find . -name '*.o' -follow -exec rm \{\} \; 151 find . -name '*.lo' -follow -exec rm \{\} \;152 116 153 117 GCC_CFLAGS = -I$(LIBC_PREFIX)/include -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ … … 155 119 -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \ 156 120 -Wall -Wextra -Wno-clobbered -Wno-unused-parameter -Wmissing-prototypes \ 157 - std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \121 -Werror-implicit-function-declaration -Wwrite-strings \ 158 122 -pipe -g -D__$(ENDIANESS)__ 159 123 … … 172 136 -pipe -g -arch $(CLANG_ARCH) -D__$(ENDIANESS)__ 173 137 174 LIB_CFLAGS = $(CFLAGS) -fPIC -D__IN_SHARED_LIBC__175 LIB_LFLAGS = $(LFLAGS) -shared -soname $(LSONAME) --whole-archive176 177 138 ifeq ($(CONFIG_DEBUG),y) 178 139 GCC_CFLAGS += -Werror … … 220 181 221 182 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) 222 LOBJECTS := $(addsuffix .lo,$(basename $(SOURCES)))223 183 224 184 ifneq ($(BINARY),) … … 231 191 232 192 $(BINARY): $(LINKER_SCRIPT) $(OBJECTS) $(LIBS) $(BASE_LIBS) 233 $(LD) - n$(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(BINARY).map -o $(BINARY) $(OBJECTS) $(LIBS) $(BASE_LIBS)193 $(LD) -N $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(BINARY).map -o $(BINARY) $(OBJECTS) $(LIBS) $(BASE_LIBS) 234 194 ifeq ($(CONFIG_STRIP_BINARIES),y) 235 195 $(STRIP) $(BINARY) 236 196 endif 237 endif238 239 ifneq ($(SLIBRARY),)240 %.disasm: $(LOUTPUT)241 ifeq ($(CONFIG_LINE_DEBUG),y)242 $(OBJDUMP) -d -S $< > $@243 else244 $(OBJDUMP) -d $< > $@245 endif246 247 $(LOUTPUT): $(LARCHIVE) $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld248 $(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld $(LIB_LFLAGS) $(LARCHIVE) -o $@ -Map $(LOUTPUT).map249 250 $(LIBRARY).so:251 ln -s $(SLIBRARY) $@252 253 $(LSONAME):254 ln -s $(SLIBRARY) $@255 197 endif 256 198 … … 258 200 %.a: $(OBJECTS) 259 201 $(AR) rc $@ $(OBJECTS) 260 endif261 262 ifneq ($(SLIBRARY),)263 %.la: $(LOBJECTS)264 $(AR) rc $@ $(LOBJECTS)265 202 endif 266 203 … … 283 220 endif 284 221 285 %.lo: %.S $(DEPEND)286 $(CC) $(DEFS) $(LIB_CFLAGS) -D__ASM__ -c $< -o $@287 ifeq ($(PRECHECK),y)288 $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(CFLAGS) -D__ASM__289 endif290 291 %.lo: %.s $(DEPEND)292 $(AS) $(AFLAGS) -o $@ $<293 ifeq ($(PRECHECK),y)294 $(JOBFILE) $(JOB) $< $@ as asm295 endif296 297 %.lo: %.c $(DEPEND)298 $(CC) $(DEFS) $(LIB_CFLAGS) -c $< -o $@299 ifeq ($(PRECHECK),y)300 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)301 endif302 303 222 $(DEPEND): $(PRE_DEPEND) 304 223 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null … … 310 229 $(OUTPUT): $(OBJECTS) 311 230 312 $(LARCHIVE): $(LOBJECTS)
Note:
See TracChangeset
for help on using the changeset viewer.