| 1 | #
|
|---|
| 2 | # Copyright (c) 2005 Martin Decky
|
|---|
| 3 | # Copyright (c) 2007 Jakub Jermar
|
|---|
| 4 | # All rights reserved.
|
|---|
| 5 | #
|
|---|
| 6 | # Redistribution and use in source and binary forms, with or without
|
|---|
| 7 | # modification, are permitted provided that the following conditions
|
|---|
| 8 | # are met:
|
|---|
| 9 | #
|
|---|
| 10 | # - Redistributions of source code must retain the above copyright
|
|---|
| 11 | # notice, this list of conditions and the following disclaimer.
|
|---|
| 12 | # - Redistributions in binary form must reproduce the above copyright
|
|---|
| 13 | # notice, this list of conditions and the following disclaimer in the
|
|---|
| 14 | # documentation and/or other materials provided with the distribution.
|
|---|
| 15 | # - The name of the author may not be used to endorse or promote products
|
|---|
| 16 | # derived from this software without specific prior written permission.
|
|---|
| 17 | #
|
|---|
| 18 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|---|
| 19 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|---|
| 20 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|---|
| 21 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|---|
| 22 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|---|
| 23 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|---|
| 24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|---|
| 25 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|---|
| 26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|---|
| 27 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|---|
| 28 | #
|
|---|
| 29 |
|
|---|
| 30 | # Individual makefiles set:
|
|---|
| 31 | #
|
|---|
| 32 | # USPACE_PREFIX (*) relative path to uspace/ directory
|
|---|
| 33 | # SOURCES (*) list of source files
|
|---|
| 34 | # LIBS libraries to link with
|
|---|
| 35 | # DEFS compiler defines
|
|---|
| 36 | # EXTRA_CFLAGS additional flags to pass to C compiler
|
|---|
| 37 | # PRE_DEPEND targets required for dependency check
|
|---|
| 38 | #
|
|---|
| 39 | # BINARY (/) binary output name (like appname)
|
|---|
| 40 | # LIBRARY (/) library output name (like libname)
|
|---|
| 41 | #
|
|---|
| 42 | # EXTRA_OUTPUT additional output targets
|
|---|
| 43 | # EXTRA_CLEAN additional cleanup targets
|
|---|
| 44 | #
|
|---|
| 45 | # Optionally, for a binary:
|
|---|
| 46 | # STATIC_NEEDED set to 'y' for init binaries, will build statically
|
|---|
| 47 | # linked version
|
|---|
| 48 | #
|
|---|
| 49 | # Optionally, for a library:
|
|---|
| 50 | # SOVERSION shared library version (major.minor),
|
|---|
| 51 | # if missing, no shared library is built
|
|---|
| 52 | #
|
|---|
| 53 | # (x) required variables
|
|---|
| 54 | # (/) exactly one of the variables must be defined
|
|---|
| 55 | #
|
|---|
| 56 |
|
|---|
| 57 | ROOT_PATH = $(USPACE_PREFIX)/..
|
|---|
| 58 |
|
|---|
| 59 | VERSION_DEF = $(ROOT_PATH)/version
|
|---|
| 60 |
|
|---|
| 61 | COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
|
|---|
| 62 | COMMON_HEADER = $(ROOT_PATH)/common.h
|
|---|
| 63 |
|
|---|
| 64 | CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
|
|---|
| 65 | CONFIG_HEADER = $(ROOT_PATH)/config.h
|
|---|
| 66 |
|
|---|
| 67 | -include $(VERSION_DEF)
|
|---|
| 68 | -include $(COMMON_MAKEFILE)
|
|---|
| 69 | -include $(CONFIG_MAKEFILE)
|
|---|
| 70 |
|
|---|
| 71 | OUTPUTS = $(EXTRA_OUTPUT)
|
|---|
| 72 |
|
|---|
| 73 | ifneq ($(BINARY),)
|
|---|
| 74 | JOB = $(BINARY).job
|
|---|
| 75 | TEST_BINARY = test-$(BINARY)
|
|---|
| 76 | OUTPUTS += $(BINARY) $(BINARY).disasm
|
|---|
| 77 | EXTRA_CLEAN += $(BINARY).map
|
|---|
| 78 | endif
|
|---|
| 79 |
|
|---|
| 80 | ifneq ($(LIBRARY),)
|
|---|
| 81 | JOB = $(LIBRARY).job
|
|---|
| 82 | TEST_BINARY = test-$(LIBRARY)
|
|---|
| 83 | OUTPUTS += $(LIBRARY).a
|
|---|
| 84 | endif
|
|---|
| 85 |
|
|---|
| 86 | ifeq ($(CONFIG_BUILD_SHARED_LIBS),y)
|
|---|
| 87 | ifneq ($(SOVERSION),)
|
|---|
| 88 | SLIBRARY = $(LIBRARY).so.$(SOVERSION)
|
|---|
| 89 | LSONAME = $(LIBRARY).so.$(basename $(SOVERSION))
|
|---|
| 90 | OUTPUTS += $(SLIBRARY) $(SLIBRARY).disasm $(LSONAME)
|
|---|
| 91 | EXTRA_CLEAN += $(LIBRARY).la $(SLIBRARY).map
|
|---|
| 92 | endif
|
|---|
| 93 | endif
|
|---|
| 94 |
|
|---|
| 95 | LIB_PREFIX = $(USPACE_PREFIX)/lib
|
|---|
| 96 |
|
|---|
| 97 | LIBC_PREFIX = $(LIB_PREFIX)/c
|
|---|
| 98 | LIBC_INCLUDES_FLAGS = \
|
|---|
| 99 | -isystem $(LIBC_PREFIX)/include \
|
|---|
| 100 | -isystem $(LIBC_PREFIX)/arch/$(UARCH)/include \
|
|---|
| 101 | -isystem $(ROOT_PATH)/abi/arch/$(KARCH)/include \
|
|---|
| 102 | -isystem $(ROOT_PATH)/abi/include
|
|---|
| 103 |
|
|---|
| 104 | LIBCPP_PREFIX = $(LIB_PREFIX)/cpp
|
|---|
| 105 | LIBCPP_INCLUDES_FLAGS = -isystem $(LIBCPP_PREFIX)/include
|
|---|
| 106 |
|
|---|
| 107 | LIBDLTEST_PREFIX = $(LIB_PREFIX)/dltest
|
|---|
| 108 |
|
|---|
| 109 | START_FILES = $(LIBC_PREFIX)/crt0.o $(LIBC_PREFIX)/crt1.o
|
|---|
| 110 |
|
|---|
| 111 | LDFLAGS = -Wl,--fatal-warnings,--warn-common
|
|---|
| 112 |
|
|---|
| 113 | STATIC_BUILD = n
|
|---|
| 114 |
|
|---|
| 115 | ifeq ($(STATIC_NEEDED),y)
|
|---|
| 116 | STATIC_BUILD = y
|
|---|
| 117 | endif
|
|---|
| 118 |
|
|---|
| 119 | ifneq ($(CONFIG_BUILD_SHARED_LIBS),y)
|
|---|
| 120 | STATIC_BUILD = y
|
|---|
| 121 | endif
|
|---|
| 122 |
|
|---|
| 123 | ifneq ($(CONFIG_USE_SHARED_LIBS),y)
|
|---|
| 124 | ifeq ($(LIBRARY),)
|
|---|
| 125 | STATIC_BUILD = y
|
|---|
| 126 | endif
|
|---|
| 127 | endif
|
|---|
| 128 |
|
|---|
| 129 | # LINK_DYNAMIC is only here to allow app/dltest to link dynamically in otherwise static build.
|
|---|
| 130 | ifeq ($(LINK_DYNAMIC),y)
|
|---|
| 131 | STATIC_BUILD = n
|
|---|
| 132 | endif
|
|---|
| 133 |
|
|---|
| 134 | ifeq ($(STATIC_BUILD),y)
|
|---|
| 135 | LDFLAGS += -static
|
|---|
| 136 | endif
|
|---|
| 137 |
|
|---|
| 138 | BASE_LIBS =
|
|---|
| 139 |
|
|---|
| 140 | ifneq ($(LIBRARY),libc)
|
|---|
| 141 | ifeq ($(STATIC_BUILD),y)
|
|---|
| 142 | BASE_LIBS += $(LIBC_PREFIX)/libc.a
|
|---|
| 143 | else
|
|---|
| 144 | BASE_LIBS += $(LIBC_PREFIX)/libc.so.0
|
|---|
| 145 | endif
|
|---|
| 146 | endif
|
|---|
| 147 |
|
|---|
| 148 | BASE_LIBS += -lgcc
|
|---|
| 149 |
|
|---|
| 150 | INCLUDES_FLAGS = $(LIBC_INCLUDES_FLAGS)
|
|---|
| 151 |
|
|---|
| 152 | ifneq ($(LIBRARY),)
|
|---|
| 153 | INCLUDES_FLAGS += -Iinclude -I.
|
|---|
| 154 | endif
|
|---|
| 155 |
|
|---|
| 156 | INCLUDES_FLAGS += $(foreach lib,$(LIBS), -I$(LIB_PREFIX)/$(lib) -I$(LIB_PREFIX)/$(lib)/include)
|
|---|
| 157 |
|
|---|
| 158 | DEPLIBS := $(LIBS)
|
|---|
| 159 |
|
|---|
| 160 | ifneq ($(filter %.cpp %.cc %.cxx, $(SOURCES)),)
|
|---|
| 161 | ifneq ($(LIBRARY),libcpp)
|
|---|
| 162 | DEPLIBS += cpp
|
|---|
| 163 | endif
|
|---|
| 164 | endif
|
|---|
| 165 |
|
|---|
| 166 | ifneq ($(LIBRARY),libc)
|
|---|
| 167 | DEPLIBS += c
|
|---|
| 168 | endif
|
|---|
| 169 |
|
|---|
| 170 | # PCUT-based unit tests
|
|---|
| 171 | ifneq ($(TEST_SOURCES),)
|
|---|
| 172 | TEST_OUTPUTS = $(TEST_BINARY) $(TEST_BINARY).disasm
|
|---|
| 173 | TEST_CFLAGS = -I$(LIB_PREFIX)/pcut/include -D__helenos__ $(EXTRA_TEST_CFLAGS)
|
|---|
| 174 | TEST_BINARY_LIBS = $(LIB_PREFIX)/pcut/libpcut.a
|
|---|
| 175 | EXTRA_CLEAN += $(TEST_OUTPUTS) $(TEST_BINARY).map
|
|---|
| 176 | ifneq ($(LIBRARY),)
|
|---|
| 177 | TEST_BINARY_LIBS += $(LIBRARY).a
|
|---|
| 178 | endif
|
|---|
| 179 | TEST_BINARY_LIBS += $(TEST_LIBS)
|
|---|
| 180 | endif
|
|---|
| 181 |
|
|---|
| 182 | # Flags that are not necessary, and can be overriden, but are used by default.
|
|---|
| 183 | DEFAULT_CFLAGS = \
|
|---|
| 184 | -O$(OPTIMIZATION) \
|
|---|
| 185 | -ffunction-sections \
|
|---|
| 186 | -fno-builtin-strftime \
|
|---|
| 187 | -pipe \
|
|---|
| 188 | -Wall \
|
|---|
| 189 | -Wextra \
|
|---|
| 190 | -Wno-unused-parameter \
|
|---|
| 191 | -Wwrite-strings \
|
|---|
| 192 | -Werror-implicit-function-declaration \
|
|---|
| 193 | -Wunknown-pragmas \
|
|---|
| 194 | -Wa,--fatal-warnings
|
|---|
| 195 |
|
|---|
| 196 | ifneq ($(COMPILER),clang)
|
|---|
| 197 | DEFAULT_CFLAGS += -Wmissing-prototypes -Wsystem-headers
|
|---|
| 198 | endif
|
|---|
| 199 |
|
|---|
| 200 | # XXX: -fno-builtin-strftime is for a seemingly spurious format warning.
|
|---|
| 201 |
|
|---|
| 202 | ifeq ($(CONFIG_DEBUG),y)
|
|---|
| 203 | DEFAULT_CFLAGS += -Werror
|
|---|
| 204 | endif
|
|---|
| 205 |
|
|---|
| 206 | ifeq ($(CONFIG_UBSAN),y)
|
|---|
| 207 | DEFAULT_CFLAGS += -fsanitize=undefined
|
|---|
| 208 | endif
|
|---|
| 209 |
|
|---|
| 210 | ifeq ($(COMPILER),clang)
|
|---|
| 211 | DEFAULT_CFLAGS += \
|
|---|
| 212 | -Wno-missing-braces \
|
|---|
| 213 | -Wno-missing-field-initializers \
|
|---|
| 214 | -Wno-typedef-redefinition \
|
|---|
| 215 | -Wno-unused-command-line-argument
|
|---|
| 216 | else
|
|---|
| 217 | DEFAULT_CFLAGS += \
|
|---|
| 218 | -Wno-nonnull-compare \
|
|---|
| 219 | -Wno-clobbered
|
|---|
| 220 | endif
|
|---|
| 221 |
|
|---|
| 222 | ifeq ($(CONFIG_LINE_DEBUG),y)
|
|---|
| 223 | DEFAULT_CFLAGS += -ggdb
|
|---|
| 224 | endif
|
|---|
| 225 |
|
|---|
| 226 | # Flags that should always be used, even for third-party software.
|
|---|
| 227 | COMMON_CPPFLAGS = \
|
|---|
| 228 | -D__$(ENDIANESS)__
|
|---|
| 229 |
|
|---|
| 230 | COMMON_CFLAGS = \
|
|---|
| 231 | -nostdlib
|
|---|
| 232 |
|
|---|
| 233 | # Flags that are always used for HelenOS code, but not for third-party.
|
|---|
| 234 | HELENOS_CFLAGS = \
|
|---|
| 235 | -std=gnu11 \
|
|---|
| 236 | $(INCLUDES_FLAGS) \
|
|---|
| 237 | -imacros $(CONFIG_HEADER) \
|
|---|
| 238 | -D_HELENOS_SOURCE \
|
|---|
| 239 | -fexec-charset=UTF-8 \
|
|---|
| 240 | -finput-charset=UTF-8 \
|
|---|
| 241 | -fno-common \
|
|---|
| 242 | -fdebug-prefix-map=$(realpath $(ROOT_PATH))=.
|
|---|
| 243 |
|
|---|
| 244 | ifeq ($(COMPILER),clang)
|
|---|
| 245 | COMMON_CFLAGS += -ffreestanding -nostdlibinc -Wno-unused-command-line-argument
|
|---|
| 246 | endif
|
|---|
| 247 |
|
|---|
| 248 | # TODO: Use a different name.
|
|---|
| 249 | # CFLAGS variable is traditionally used for overridable flags.
|
|---|
| 250 | CFLAGS = $(COMMON_CPPFLAGS) $(COMMON_CFLAGS) $(HELENOS_CFLAGS) $(DEFAULT_CFLAGS)
|
|---|
| 251 |
|
|---|
| 252 | # Flags for the compilation of C++ code.
|
|---|
| 253 | CXX_BASE_LIBS = $(LIBCPP_PREFIX)/libcpp.a $(BASE_LIBS)
|
|---|
| 254 | DEFAULT_CXXFLAGS = \
|
|---|
| 255 | -O$(OPTIMIZATION) \
|
|---|
| 256 | -ffunction-sections \
|
|---|
| 257 | -pipe \
|
|---|
| 258 | -Wall \
|
|---|
| 259 | -Wextra \
|
|---|
| 260 | -Wno-unused-parameter \
|
|---|
| 261 | -Wwrite-strings \
|
|---|
| 262 | -Werror-implicit-function-declaration
|
|---|
| 263 |
|
|---|
| 264 | ifeq ($(CONFIG_DEBUG),y)
|
|---|
| 265 | DEFAULT_CXXFLAGS += -Werror
|
|---|
| 266 | endif
|
|---|
| 267 |
|
|---|
| 268 | COMMON_CXXFLAGS = $(COMMON_CFLAGS) -fno-exceptions
|
|---|
| 269 | HELENOS_CXXFLAGS = \
|
|---|
| 270 | -std=c++17 -frtti \
|
|---|
| 271 | $(LIBCPP_INCLUDES_FLAGS) $(INCLUDES_FLAGS) \
|
|---|
| 272 | -imacros $(CONFIG_HEADER) \
|
|---|
| 273 | -D_HELENOS_SOURCE \
|
|---|
| 274 | -fexec-charset=UTF-8 \
|
|---|
| 275 | -finput-charset=UTF-8 \
|
|---|
| 276 | -fno-common \
|
|---|
| 277 | -fdebug-prefix-map=$(realpath $(ROOT_PATH))=.
|
|---|
| 278 |
|
|---|
| 279 | CXXFLAGS = $(COMMON_CPPFLAGS) $(COMMON_CXXFLAGS) $(HELENOS_CXXFLAGS) $(DEFAULT_CXXFLAGS)
|
|---|
| 280 |
|
|---|
| 281 | ## Setup platform configuration
|
|---|
| 282 | #
|
|---|
| 283 |
|
|---|
| 284 | -include $(LIBC_PREFIX)/arch/$(UARCH)/Makefile.common
|
|---|
| 285 |
|
|---|
| 286 | ## Compilation options
|
|---|
| 287 | #
|
|---|
| 288 |
|
|---|
| 289 | ifeq ($(PRECHECK),y)
|
|---|
| 290 | JOBFILE = $(LIBC_PREFIX)/../../../tools/jobfile.py
|
|---|
| 291 | # NOTE: You must not change the order of arguments.
|
|---|
| 292 | CC_JOB = $(JOBFILE) $(JOB) $(CC) $< -o $@
|
|---|
| 293 | CXX_JOB = $(JOBFILE) $(JOB) $(CXX) $< -o $@
|
|---|
| 294 | else
|
|---|
| 295 | CC_JOB = $(CC) $< -o $@
|
|---|
| 296 | CXX_JOB = $(CXX) $< -o $@
|
|---|
| 297 | endif
|
|---|
| 298 |
|
|---|
| 299 | ifeq ($(CONFIG_STRIP_BINARIES),y)
|
|---|
| 300 | LDFLAGS += -s
|
|---|
| 301 | endif
|
|---|
| 302 |
|
|---|
| 303 | LIB_CFLAGS = $(CFLAGS) -fPIC
|
|---|
| 304 | LIB_CXXFLAGS = $(CXXFLAGS) -fPIC
|
|---|
| 305 | LIB_LDFLAGS = $(LDFLAGS) -shared -Wl,-soname,$(LSONAME) -Wl,--no-undefined,--no-allow-shlib-undefined
|
|---|
| 306 |
|
|---|
| 307 | OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
|
|---|
| 308 | LOBJECTS := $(addsuffix .lo,$(basename $(SOURCES)))
|
|---|
| 309 | TEST_OBJECTS := $(addsuffix .test.o,$(basename $(TEST_SOURCES)))
|
|---|
| 310 | DEPENDS := $(addsuffix .d,$(basename $(SOURCES))) $(addsuffix .test.d,$(basename $(TEST_SOURCES)))
|
|---|
| 311 |
|
|---|
| 312 | LIBTAGS := $(foreach lib,$(DEPLIBS), $(USPACE_PREFIX)/lib/$(lib)/tag)
|
|---|
| 313 | LIBARGS := $(addprefix -L$(USPACE_PREFIX)/lib/, $(LIBS)) $(addprefix -l, $(LIBS))
|
|---|
| 314 |
|
|---|
| 315 | .PHONY: all all-test clean fasterclean depend
|
|---|
| 316 |
|
|---|
| 317 | all: tag $(OUTPUTS)
|
|---|
| 318 |
|
|---|
| 319 | all-test: $(TEST_OUTPUTS)
|
|---|
| 320 |
|
|---|
| 321 | clean: fasterclean
|
|---|
| 322 | find . -name '*.o' -follow -exec rm \{\} \;
|
|---|
| 323 | find . -name '*.lo' -follow -exec rm \{\} \;
|
|---|
| 324 | find . -name '*.d' -follow -exec rm \{\} \;
|
|---|
| 325 |
|
|---|
| 326 | fasterclean:
|
|---|
| 327 | rm -rf $(JOB) $(OUTPUTS) $(EXTRA_CLEAN) tag deps.mk
|
|---|
| 328 |
|
|---|
| 329 | depend: $(PRE_DEPEND)
|
|---|
| 330 |
|
|---|
| 331 | # "Tag" files are used to force relink of binaries when dependencies get rebuilt,
|
|---|
| 332 | # regardless of whether the dependency was linked statically or dynamically,
|
|---|
| 333 | # or which version of a dynamic library was used. Prerequisites for this file
|
|---|
| 334 | # are defined further down.
|
|---|
| 335 | tag:
|
|---|
| 336 | touch tag
|
|---|
| 337 |
|
|---|
| 338 | # Generate inter-module make dependencies.
|
|---|
| 339 | # This is needed to ensure correct build order of libraries and code depending on them.
|
|---|
| 340 | deps.mk: Makefile
|
|---|
| 341 | echo > $@.new
|
|---|
| 342 | for lib in $(DEPLIBS); do \
|
|---|
| 343 | echo "$(SELF_TARGET): lib/$$lib.build" >> $@.new; \
|
|---|
| 344 | done
|
|---|
| 345 | mv -f $@.new $@
|
|---|
| 346 |
|
|---|
| 347 | %.disasm: %
|
|---|
| 348 | ifeq ($(CONFIG_LINE_DEBUG),y)
|
|---|
| 349 | $(OBJDUMP) -d -S $< > $@
|
|---|
| 350 | else
|
|---|
| 351 | $(OBJDUMP) -d $< > $@
|
|---|
| 352 | endif
|
|---|
| 353 |
|
|---|
| 354 | ifneq ($(BINARY),)
|
|---|
| 355 |
|
|---|
| 356 | ifneq ($(filter %.cpp %.cc %.cxx, $(SOURCES)),)
|
|---|
| 357 | $(BINARY): $(OBJECTS) $(LIBTAGS)
|
|---|
| 358 | $(CXX) $(CXXFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) -Wl,-Map,$@.map -o $@ $(START_FILES) $(OBJECTS) $(LIBARGS) $(CXX_BASE_LIBS)
|
|---|
| 359 | else
|
|---|
| 360 | $(BINARY): $(OBJECTS) $(LIBTAGS)
|
|---|
| 361 | $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) -Wl,-Map,$@.map -o $@ $(START_FILES) $(OBJECTS) $(LIBARGS) $(BASE_LIBS)
|
|---|
| 362 | endif
|
|---|
| 363 |
|
|---|
| 364 | endif
|
|---|
| 365 |
|
|---|
| 366 | ifneq ($(TEST_BINARY),)
|
|---|
| 367 | $(TEST_BINARY): $(TEST_OBJECTS) $(TEST_BINARY_LIBS) $(LIBTAGS)
|
|---|
| 368 | $(CC) $(CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) -Wl,-Map,$@.map -o $@ $(START_FILES) $(TEST_OBJECTS) $(TEST_BINARY_LIBS) $(LIBARGS) $(BASE_LIBS)
|
|---|
| 369 | endif
|
|---|
| 370 |
|
|---|
| 371 | ifneq ($(LIBRARY),)
|
|---|
| 372 | tag: $(LIBRARY).a
|
|---|
| 373 |
|
|---|
| 374 | $(LIBRARY).a: $(OBJECTS)
|
|---|
| 375 | $(AR) rc $@ $(OBJECTS)
|
|---|
| 376 | endif
|
|---|
| 377 |
|
|---|
| 378 | ifneq ($(SLIBRARY),)
|
|---|
| 379 | tag: $(SLIBRARY)
|
|---|
| 380 |
|
|---|
| 381 | $(LIBRARY).la: $(LOBJECTS)
|
|---|
| 382 | $(AR) rc $@ $(LOBJECTS)
|
|---|
| 383 |
|
|---|
| 384 | $(SLIBRARY): $(LIBRARY).la $(LIBTAGS)
|
|---|
| 385 | $(CC) $(CFLAGS) $(LIB_LDFLAGS) $(EXTRA_LDFLAGS) -Wl,-Map,$@.map -o $@ -Wl,--whole-archive $(LIBRARY).la -Wl,--no-whole-archive $(LIBARGS) $(BASE_LIBS)
|
|---|
| 386 |
|
|---|
| 387 | $(LSONAME):
|
|---|
| 388 | ln -s $(SLIBRARY) $@
|
|---|
| 389 | endif
|
|---|
| 390 |
|
|---|
| 391 | %.o: %.S | depend
|
|---|
| 392 | $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS)
|
|---|
| 393 |
|
|---|
| 394 | %.o: %.s | depend
|
|---|
| 395 | $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS)
|
|---|
| 396 |
|
|---|
| 397 | %.o: %.c | depend
|
|---|
| 398 | $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS)
|
|---|
| 399 |
|
|---|
| 400 | %.o: %.cpp | depend
|
|---|
| 401 | $(CXX_JOB) -c -MD -MP $(DEFS) $(CXXFLAGS) $(EXTRA_CXXFLAGS)
|
|---|
| 402 |
|
|---|
| 403 | %.o: %.cxx | depend
|
|---|
| 404 | $(CXX_JOB) -c -MD -MP $(DEFS) $(CXXFLAGS) $(EXTRA_CXXFLAGS)
|
|---|
| 405 |
|
|---|
| 406 | %.o: %.cc | depend
|
|---|
| 407 | $(CXX_JOB) -c -MD -MP $(DEFS) $(CXXFLAGS) $(EXTRA_CXXFLAGS)
|
|---|
| 408 |
|
|---|
| 409 | %.test.o: %.c | depend
|
|---|
| 410 | $(CC_JOB) -c -MD -MP $(DEFS) $(CFLAGS) $(EXTRA_CFLAGS) $(TEST_CFLAGS)
|
|---|
| 411 |
|
|---|
| 412 | %.lo: %.S | depend
|
|---|
| 413 | $(CC_JOB) -c -MD -MP $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS)
|
|---|
| 414 |
|
|---|
| 415 | %.lo: %.s | depend
|
|---|
| 416 | $(CC_JOB) -c -MD -MP $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS)
|
|---|
| 417 |
|
|---|
| 418 | %.lo: %.c | depend
|
|---|
| 419 | $(CC_JOB) -c -MD -MP $(DEFS) $(LIB_CFLAGS) $(EXTRA_CFLAGS)
|
|---|
| 420 |
|
|---|
| 421 | %.lo: %.cpp | depend
|
|---|
| 422 | $(CXX_JOB) -c -MD -MP $(DEFS) $(LIB_CXXFLAGS) $(EXTRA_CXXFLAGS)
|
|---|
| 423 |
|
|---|
| 424 | %.lo: %.cxx | depend
|
|---|
| 425 | $(CXX_JOB) -c -MD -MP $(DEFS) $(LIB_CXXFLAGS) $(EXTRA_CXXFLAGS)
|
|---|
| 426 |
|
|---|
| 427 | %.lo: %.cc | depend
|
|---|
| 428 | $(CXX_JOB) -c -MD -MP $(DEFS) $(LIB_CXXFLAGS) $(EXTRA_CXXFLAGS)
|
|---|
| 429 |
|
|---|
| 430 | -include $(DEPENDS)
|
|---|