[125] | 1 | ######################################################### |
---|
| 2 | # check CONFIG parameter |
---|
| 3 | ######################################################### |
---|
| 4 | |
---|
| 5 | ifneq ($(CONFIG), LIBRARY) |
---|
| 6 | ifneq ($(CONFIG), CONSOLE) |
---|
| 7 | CONFIG_ERR = TRUE |
---|
| 8 | endif |
---|
| 9 | endif |
---|
| 10 | |
---|
| 11 | ######################################################### |
---|
| 12 | # executables used |
---|
| 13 | ######################################################### |
---|
| 14 | |
---|
[1029] | 15 | CPP = g++ |
---|
| 16 | CC = gcc |
---|
[125] | 17 | AR = ar |
---|
| 18 | LD = $(CPP) |
---|
| 19 | ASM = nasm |
---|
| 20 | |
---|
| 21 | ######################################################### |
---|
| 22 | # output file names and version information |
---|
| 23 | ######################################################### |
---|
| 24 | |
---|
| 25 | ifeq ($(CONFIG), LIBRARY) |
---|
| 26 | # the libraries that can be created |
---|
| 27 | STAT_DEBUG_OUT = $(LIB_DIR)/lib$(PRJ_NAME)Staticd.a |
---|
| 28 | STAT_RELEASE_OUT = $(LIB_DIR)/lib$(PRJ_NAME)Static.a |
---|
| 29 | DYN_DEBUG_OUT = $(LIB_DIR)/lib$(PRJ_NAME)d.so |
---|
| 30 | DYN_RELEASE_OUT = $(LIB_DIR)/lib$(PRJ_NAME).so |
---|
| 31 | # |
---|
| 32 | else |
---|
| 33 | ifeq ($(CONFIG), CONSOLE) |
---|
| 34 | # the executables that can be created |
---|
| 35 | STAT_DEBUG_OUT = $(BIN_DIR)/$(PRJ_NAME)Staticd |
---|
| 36 | STAT_RELEASE_OUT = $(BIN_DIR)/$(PRJ_NAME)Static |
---|
| 37 | DYN_DEBUG_OUT = $(BIN_DIR)/$(PRJ_NAME)d |
---|
| 38 | DYN_RELEASE_OUT = $(BIN_DIR)/$(PRJ_NAME) |
---|
| 39 | # |
---|
| 40 | endif |
---|
| 41 | endif |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | ######################################################### |
---|
| 45 | # c compiler flags |
---|
| 46 | ######################################################### |
---|
| 47 | |
---|
| 48 | # default cpp flags for all configurations |
---|
| 49 | #CPPFLAGS = -Wall -fPIC $(DEFS) -I$(CURDIR)/$(INC_DIR) $(USER_INC_DIRS) |
---|
[1129] | 50 | CPPFLAGS = -fPIC $(DEFS) -I$(CURDIR)/$(INC_DIR) $(USER_INC_DIRS) -Wall -Wshadow -Wno-sign-compare -Werror |
---|
[125] | 51 | |
---|
| 52 | ########## |
---|
| 53 | # enforce 32-bit build : 1=yes, 0=no |
---|
| 54 | ########## |
---|
| 55 | M32?= 0 |
---|
| 56 | ifeq ($(M32),1) |
---|
| 57 | CPPFLAGS+=-m32 |
---|
| 58 | endif |
---|
| 59 | ########## |
---|
| 60 | |
---|
[1029] | 61 | ifeq ($(HIGHBITDEPTH), 1) |
---|
| 62 | CPPFLAGS+="-DRExt__HIGH_BIT_DEPTH_SUPPORT=1" |
---|
| 63 | endif |
---|
| 64 | |
---|
[125] | 65 | # |
---|
| 66 | # debug cpp flags |
---|
| 67 | DEBUG_CPPFLAGS = -g -D_DEBUG |
---|
| 68 | # |
---|
| 69 | # release cpp |
---|
[1029] | 70 | RELEASE_CPPFLAGS = -O3 -Wuninitialized |
---|
[125] | 71 | |
---|
| 72 | |
---|
| 73 | ######################################################### |
---|
| 74 | # assembler compiler flags |
---|
| 75 | ######################################################### |
---|
| 76 | |
---|
| 77 | # default asm flags for all configurations |
---|
| 78 | ASMFLAGS = -f elf $(DEFS) |
---|
| 79 | # |
---|
| 80 | # debug asm flags |
---|
| 81 | DEBUG_ASMFLAGS = -g |
---|
| 82 | # |
---|
| 83 | # release asm flags |
---|
| 84 | RELEASE_ASMFLAGS = |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | ######################################################### |
---|
| 89 | # linker flags |
---|
| 90 | ######################################################### |
---|
| 91 | |
---|
| 92 | # linker flags for all |
---|
| 93 | ALL_LDFLAGS = -Wall |
---|
| 94 | |
---|
| 95 | ########## |
---|
| 96 | # enforce 32-bit build : 1=yes, 0=no |
---|
| 97 | ########## |
---|
| 98 | ifeq ($(M32),1) |
---|
| 99 | ALL_LDFLAGS+=-m32 |
---|
| 100 | endif |
---|
| 101 | ########## |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | ifeq ($(CONFIG), LIBRARY) |
---|
| 105 | # linker flags for library |
---|
| 106 | # LDFLAGS = $(ALL_LDFLAGS) -shared -Wl,-Bsymbolic |
---|
| 107 | LDFLAGS = $(ALL_LDFLAGS) -shared |
---|
| 108 | # |
---|
| 109 | # debug linker flags for library |
---|
| 110 | DEBUG_LDFLAGS = -Wl,-soname,lib$(PRJ_NAME)d.so.$(VER) |
---|
| 111 | # |
---|
| 112 | # release linker flags for library |
---|
| 113 | RELEASE_LDFLAGS = -Wl,-soname,lib$(PRJ_NAME).so.$(VER) |
---|
| 114 | # |
---|
| 115 | else |
---|
| 116 | ifeq ($(CONFIG), CONSOLE) |
---|
| 117 | # linker flags for console |
---|
| 118 | LDFLAGS = $(ALL_LDFLAGS) |
---|
| 119 | # |
---|
| 120 | # debug linker flags for console |
---|
| 121 | DEBUG_LDFLAGS = |
---|
| 122 | # |
---|
| 123 | # release linker flags for console |
---|
| 124 | RELEASE_LDFLAGS = |
---|
| 125 | # |
---|
| 126 | endif |
---|
| 127 | endif |
---|
| 128 | |
---|
| 129 | |
---|
| 130 | |
---|
| 131 | ######################################################### |
---|
| 132 | # objects that have to be created |
---|
| 133 | ######################################################### |
---|
| 134 | |
---|
| 135 | # the object types that have to be created |
---|
| 136 | RELEASE_OBJS = $(OBJS:.o=.r.o) |
---|
| 137 | DEBUG_OBJS = $(OBJS:.o=.d.o) |
---|
| 138 | |
---|
| 139 | |
---|
| 140 | ######################################################### |
---|
| 141 | # rules |
---|
| 142 | ######################################################### |
---|
| 143 | |
---|
| 144 | # suffixes |
---|
| 145 | .SUFFIXES: .cpp .asm .r.o .d.o |
---|
| 146 | |
---|
| 147 | ######################################################### |
---|
| 148 | # assembler rules |
---|
| 149 | ######################################################### |
---|
| 150 | |
---|
| 151 | |
---|
| 152 | # create release objects |
---|
| 153 | $(OBJ_DIR)/%.r.o: $(SRC_DIR)/%.asm |
---|
| 154 | $(ASM) $(ASMFLAGS) $(RELEASE_ASMFLAGS) -o $@ $< |
---|
| 155 | |
---|
| 156 | # create debug objects |
---|
| 157 | $(OBJ_DIR)/%.d.o: $(SRC_DIR)/%.asm |
---|
| 158 | $(ASM) $(ASMFLAGS) $(DEBUG_ASMFLAGS) -o $@ $< |
---|
| 159 | |
---|
| 160 | # create release objects |
---|
| 161 | $(OBJ_DIR)/%.r.o: $(SRC_DIR1)/%.asm |
---|
| 162 | $(ASM) $(ASMFLAGS) $(RELEASE_ASMFLAGS) -o $@ $< |
---|
| 163 | |
---|
| 164 | # create debug objects |
---|
| 165 | $(OBJ_DIR)/%.d.o: $(SRC_DIR1)/%.asm |
---|
| 166 | $(ASM) $(ASMFLAGS) $(DEBUG_ASMFLAGS) -o $@ $< |
---|
| 167 | |
---|
| 168 | # create release objects |
---|
| 169 | $(OBJ_DIR)/%.r.o: $(SRC_DIR2)/%.asm |
---|
| 170 | $(ASM) $(ASMFLAGS) $(RELEASE_ASMFLAGS) -o $@ $< |
---|
| 171 | |
---|
| 172 | # create debug objects |
---|
| 173 | $(OBJ_DIR)/%.d.o: $(SRC_DIR2)/%.asm |
---|
| 174 | $(ASM) $(ASMFLAGS) $(DEBUG_ASMFLAGS) -o $@ $< |
---|
| 175 | |
---|
| 176 | # create release objects |
---|
| 177 | $(OBJ_DIR)/%.r.o: $(SRC_DIR3)/%.asm |
---|
| 178 | $(ASM) $(ASMFLAGS) $(RELEASE_ASMFLAGS) -o $@ $< |
---|
| 179 | |
---|
| 180 | # create debug objects |
---|
| 181 | $(OBJ_DIR)/%.d.o: $(SRC_DIR3)/%.asm |
---|
| 182 | $(ASM) $(ASMFLAGS) $(DEBUG_ASMFLAGS) -o $@ $< |
---|
| 183 | |
---|
| 184 | # create release objects |
---|
| 185 | $(OBJ_DIR)/%.r.o: $(SRC_DIR4)/%.asm |
---|
| 186 | $(ASM) $(ASMFLAGS) $(RELEASE_ASMFLAGS) -o $@ $< |
---|
| 187 | |
---|
| 188 | # create debug objects |
---|
| 189 | $(OBJ_DIR)/%.d.o: $(SRC_DIR4)/%.asm |
---|
| 190 | $(ASM) $(ASMFLAGS) $(DEBUG_ASMFLAGS) -o $@ $< |
---|
| 191 | |
---|
| 192 | |
---|
| 193 | |
---|
| 194 | ######################################################### |
---|
| 195 | # c rules |
---|
| 196 | ######################################################### |
---|
| 197 | |
---|
| 198 | # Generate dependency files during compilation |
---|
| 199 | # see also: http://make.paulandlesley.org/autodep.html |
---|
| 200 | # 2005-01-25 Steffen Kamp (kamp@ient.rwth-aachen.de), RWTH Aachen |
---|
| 201 | define COMPILE_AND_DEPEND_RELEASE |
---|
| 202 | $(CPP) -c -MMD -MF $(OBJ_DIR)/$*.r.d -MT $(OBJ_DIR)/$*.r.o $(CPPFLAGS) $(RELEASE_CPPFLAGS) -o $@ $(CURDIR)/$< |
---|
| 203 | @cp $(OBJ_DIR)/$*.r.d $(OBJ_DIR)/$*.r.P; \ |
---|
| 204 | sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ |
---|
| 205 | -e '/^$$/ d' -e 's/$$/ :/' < $(OBJ_DIR)/$*.r.d >> $(OBJ_DIR)/$*.r.P; \ |
---|
| 206 | rm -f $(OBJ_DIR)/$*.r.d |
---|
| 207 | endef |
---|
| 208 | define COMPILE_AND_DEPEND_DEBUG |
---|
| 209 | $(CPP) -c -MMD -MF $(OBJ_DIR)/$*.d.d -MT $(OBJ_DIR)/$*.d.o $(CPPFLAGS) $(DEBUG_CPPFLAGS) -o $@ $(CURDIR)/$< |
---|
| 210 | @cp $(OBJ_DIR)/$*.d.d $(OBJ_DIR)/$*.d.P; \ |
---|
| 211 | sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ |
---|
| 212 | -e '/^$$/ d' -e 's/$$/ :/' < $(OBJ_DIR)/$*.d.d >> $(OBJ_DIR)/$*.d.P; \ |
---|
| 213 | rm -f $(OBJ_DIR)/$*.d.d |
---|
| 214 | endef |
---|
[1029] | 215 | define COMPILE_AND_DEPEND_RELEASE_C |
---|
| 216 | $(CC) -c -MMD -MF $(OBJ_DIR)/$*.r.d -MT $(OBJ_DIR)/$*.r.o $(CPPFLAGS) $(RELEASE_CPPFLAGS) -o $@ $(CURDIR)/$< |
---|
| 217 | @cp $(OBJ_DIR)/$*.r.d $(OBJ_DIR)/$*.r.P; \ |
---|
| 218 | sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ |
---|
| 219 | -e '/^$$/ d' -e 's/$$/ :/' < $(OBJ_DIR)/$*.r.d >> $(OBJ_DIR)/$*.r.P; \ |
---|
| 220 | rm -f $(OBJ_DIR)/$*.r.d |
---|
| 221 | endef |
---|
| 222 | define COMPILE_AND_DEPEND_DEBUG_C |
---|
| 223 | $(CC) -c -MMD -MF $(OBJ_DIR)/$*.d.d -MT $(OBJ_DIR)/$*.d.o $(CPPFLAGS) $(DEBUG_CPPFLAGS) -o $@ $(CURDIR)/$< |
---|
| 224 | @cp $(OBJ_DIR)/$*.d.d $(OBJ_DIR)/$*.d.P; \ |
---|
| 225 | sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ |
---|
| 226 | -e '/^$$/ d' -e 's/$$/ :/' < $(OBJ_DIR)/$*.d.d >> $(OBJ_DIR)/$*.d.P; \ |
---|
| 227 | rm -f $(OBJ_DIR)/$*.d.d |
---|
| 228 | endef |
---|
[125] | 229 | |
---|
| 230 | # create release objects |
---|
| 231 | $(OBJ_DIR)/%.r.o: $(SRC_DIR)/%.cpp |
---|
| 232 | $(COMPILE_AND_DEPEND_RELEASE) |
---|
| 233 | |
---|
| 234 | # create debug objects |
---|
| 235 | $(OBJ_DIR)/%.d.o: $(SRC_DIR)/%.cpp |
---|
| 236 | $(COMPILE_AND_DEPEND_DEBUG) |
---|
| 237 | |
---|
| 238 | # create release objects |
---|
| 239 | $(OBJ_DIR)/%.r.o: $(SRC_DIR1)/%.cpp |
---|
| 240 | $(COMPILE_AND_DEPEND_RELEASE) |
---|
| 241 | |
---|
| 242 | # create debug objects |
---|
| 243 | $(OBJ_DIR)/%.d.o: $(SRC_DIR1)/%.cpp |
---|
| 244 | $(COMPILE_AND_DEPEND_DEBUG) |
---|
| 245 | |
---|
| 246 | # create release objects |
---|
| 247 | $(OBJ_DIR)/%.r.o: $(SRC_DIR2)/%.cpp |
---|
| 248 | $(COMPILE_AND_DEPEND_RELEASE) |
---|
| 249 | |
---|
| 250 | # create debug objects |
---|
| 251 | $(OBJ_DIR)/%.d.o: $(SRC_DIR2)/%.cpp |
---|
| 252 | $(COMPILE_AND_DEPEND_DEBUG) |
---|
| 253 | |
---|
| 254 | # create release objects |
---|
| 255 | $(OBJ_DIR)/%.r.o: $(SRC_DIR3)/%.cpp |
---|
| 256 | $(COMPILE_AND_DEPEND_RELEASE) |
---|
| 257 | |
---|
| 258 | # create debug objects |
---|
| 259 | $(OBJ_DIR)/%.d.o: $(SRC_DIR3)/%.cpp |
---|
| 260 | $(COMPILE_AND_DEPEND_DEBUG) |
---|
| 261 | |
---|
| 262 | # create release objects |
---|
| 263 | $(OBJ_DIR)/%.r.o: $(SRC_DIR4)/%.cpp |
---|
| 264 | $(COMPILE_AND_DEPEND_RELEASE) |
---|
| 265 | |
---|
| 266 | # create debug objects |
---|
| 267 | $(OBJ_DIR)/%.d.o: $(SRC_DIR4)/%.cpp |
---|
| 268 | $(COMPILE_AND_DEPEND_DEBUG) |
---|
| 269 | |
---|
| 270 | # create release objects |
---|
| 271 | $(OBJ_DIR)/%.r.o: $(SRC_DIR)/%.c |
---|
[1029] | 272 | $(COMPILE_AND_DEPEND_RELEASE_C) |
---|
[125] | 273 | |
---|
| 274 | # create debug objects |
---|
| 275 | $(OBJ_DIR)/%.d.o: $(SRC_DIR)/%.c |
---|
[1029] | 276 | $(COMPILE_AND_DEPEND_DEBUG_C) |
---|
[125] | 277 | |
---|
| 278 | # create release objects |
---|
| 279 | $(OBJ_DIR)/%.r.o: $(SRC_DIR1)/%.c |
---|
[1029] | 280 | $(COMPILE_AND_DEPEND_RELEASE_C) |
---|
[125] | 281 | |
---|
| 282 | # create debug objects |
---|
| 283 | $(OBJ_DIR)/%.d.o: $(SRC_DIR1)/%.c |
---|
[1029] | 284 | $(COMPILE_AND_DEPEND_DEBUG_C) |
---|
[125] | 285 | |
---|
| 286 | # create release objects |
---|
| 287 | $(OBJ_DIR)/%.r.o: $(SRC_DIR2)/%.c |
---|
[1029] | 288 | $(COMPILE_AND_DEPEND_RELEASE_C) |
---|
[125] | 289 | |
---|
| 290 | # create debug objects |
---|
| 291 | $(OBJ_DIR)/%.d.o: $(SRC_DIR2)/%.c |
---|
[1029] | 292 | $(COMPILE_AND_DEPEND_DEBUG_C) |
---|
[125] | 293 | |
---|
| 294 | # create release objects |
---|
| 295 | $(OBJ_DIR)/%.r.o: $(SRC_DIR3)/%.c |
---|
[1029] | 296 | $(COMPILE_AND_DEPEND_RELEASE_C) |
---|
[125] | 297 | |
---|
| 298 | # create debug objects |
---|
| 299 | $(OBJ_DIR)/%.d.o: $(SRC_DIR3)/%.c |
---|
[1029] | 300 | $(COMPILE_AND_DEPEND_DEBUG_C) |
---|
[125] | 301 | |
---|
| 302 | # create release objects |
---|
| 303 | $(OBJ_DIR)/%.r.o: $(SRC_DIR4)/%.c |
---|
[1029] | 304 | $(COMPILE_AND_DEPEND_RELEASE_C) |
---|
[125] | 305 | |
---|
| 306 | # create debug objects |
---|
| 307 | $(OBJ_DIR)/%.d.o: $(SRC_DIR4)/%.c |
---|
[1029] | 308 | $(COMPILE_AND_DEPEND_DEBUG_C) |
---|
[125] | 309 | |
---|
| 310 | |
---|
| 311 | ######################################################### |
---|
| 312 | # directory settings |
---|
| 313 | ######################################################### |
---|
| 314 | |
---|
| 315 | ifeq ($(CONFIG), LIBRARY) |
---|
| 316 | # directories that have to be created for a library |
---|
| 317 | CHECK_DIRS = $(OBJ_DIR) $(LIB_DIR) |
---|
| 318 | # |
---|
| 319 | else |
---|
| 320 | ifeq ($(CONFIG), CONSOLE) |
---|
| 321 | # directories that have to be created for console and MFC |
---|
| 322 | CHECK_DIRS = $(OBJ_DIR) $(BIN_DIR) |
---|
| 323 | # |
---|
| 324 | endif |
---|
| 325 | endif |
---|
| 326 | |
---|
| 327 | |
---|
| 328 | ######################################################### |
---|
| 329 | # targets |
---|
| 330 | ######################################################### |
---|
| 331 | |
---|
| 332 | all: check_errors debug release |
---|
| 333 | |
---|
| 334 | debug: check_errors \ |
---|
| 335 | $(CHECK_DIRS) \ |
---|
| 336 | $(STAT_DEBUG_OUT) |
---|
| 337 | |
---|
| 338 | release: check_errors \ |
---|
| 339 | $(CHECK_DIRS) \ |
---|
| 340 | $(STAT_RELEASE_OUT) |
---|
| 341 | |
---|
| 342 | |
---|
| 343 | #all: check_errors debug release |
---|
| 344 | # |
---|
| 345 | #debug: check_errors \ |
---|
| 346 | # $(CHECK_DIRS) \ |
---|
| 347 | # $(DYN_DEBUG_OUT) \ |
---|
| 348 | # $(STAT_DEBUG_OUT) |
---|
| 349 | # |
---|
| 350 | #release: check_errors \ |
---|
| 351 | # $(CHECK_DIRS) \ |
---|
| 352 | # $(DYN_RELEASE_OUT) \ |
---|
| 353 | # $(STAT_RELEASE_OUT) |
---|
| 354 | # |
---|
| 355 | #stat_debug: check_errors \ |
---|
| 356 | # $(CHECK_DIRS) \ |
---|
| 357 | # $(STAT_DEBUG_OUT) |
---|
| 358 | # |
---|
| 359 | #dyn_debug: check_errors \ |
---|
| 360 | # $(CHECK_DIRS) \ |
---|
| 361 | # $(DYN_DEBUG_OUT) |
---|
| 362 | # |
---|
| 363 | #stat_release: check_errors \ |
---|
| 364 | # $(CHECK_DIRS) \ |
---|
| 365 | # $(STAT_RELEASE_OUT) |
---|
| 366 | # |
---|
| 367 | #dyn_release: check_errors \ |
---|
| 368 | # $(CHECK_DIRS) \ |
---|
| 369 | # $(DYN_RELEASE_OUT) |
---|
| 370 | |
---|
| 371 | ########################################################## |
---|
| 372 | # check for errors |
---|
| 373 | ########################################################## |
---|
| 374 | check_errors: |
---|
| 375 | @if [ "$(CONFIG_ERR)" = "TRUE" ]; then\ |
---|
| 376 | echo "Wrong CONFIG parameter specified: $(CONFIG)";\ |
---|
| 377 | false;\ |
---|
| 378 | fi |
---|
| 379 | |
---|
| 380 | |
---|
| 381 | ########################################################## |
---|
| 382 | # create directories |
---|
| 383 | ########################################################## |
---|
| 384 | |
---|
| 385 | $(OBJ_DIR): |
---|
| 386 | @if [ ! -d $(OBJ_DIR) ]; then\ |
---|
| 387 | mkdir $(OBJ_DIR);\ |
---|
| 388 | fi |
---|
| 389 | |
---|
| 390 | $(LIB_DIR): |
---|
| 391 | @if [ ! -d $(LIB_DIR) ]; then\ |
---|
| 392 | mkdir $(LIB_DIR);\ |
---|
| 393 | fi |
---|
| 394 | |
---|
| 395 | $(BIN_DIR): |
---|
| 396 | @if [ ! -d $(BIN_DIR) ]; then\ |
---|
| 397 | mkdir $(BIN_DIR);\ |
---|
| 398 | fi |
---|
| 399 | |
---|
| 400 | |
---|
| 401 | |
---|
| 402 | ########################################################## |
---|
| 403 | # create output files |
---|
| 404 | ########################################################## |
---|
| 405 | |
---|
| 406 | ifeq ($(CONFIG), LIBRARY) |
---|
| 407 | # |
---|
| 408 | # create static debug out |
---|
| 409 | $(STAT_DEBUG_OUT): $(DEBUG_OBJS) |
---|
| 410 | $(AR) -crs $@ $(DEBUG_OBJS) |
---|
| 411 | # |
---|
| 412 | # |
---|
| 413 | # create release debug out |
---|
| 414 | $(STAT_RELEASE_OUT): $(RELEASE_OBJS) |
---|
| 415 | $(AR) -crs $@ $(RELEASE_OBJS) |
---|
| 416 | # |
---|
| 417 | # |
---|
| 418 | # create dynamic debug out |
---|
| 419 | $(DYN_DEBUG_OUT): $(DYN_DEBUG_OUT).$(VER) |
---|
| 420 | ln -fs lib$(PRJ_NAME)d.so.$(VER) $@ |
---|
| 421 | # |
---|
| 422 | # create dynamic debug out |
---|
| 423 | $(DYN_DEBUG_OUT).$(VER): $(DEBUG_OBJS) |
---|
| 424 | $(LD) $(LDFLAGS) $(DEBUG_LDFLAGS) -o $@ $(DEBUG_OBJS) -L$(LIB_DIR) $(USER_LIB_DIRS) $(LIBS) $(DEBUG_LIBS) $(DYN_LIBS) $(DYN_DEBUG_LIBS) |
---|
| 425 | # |
---|
| 426 | # |
---|
| 427 | # create dynamic release out |
---|
| 428 | $(DYN_RELEASE_OUT): $(DYN_RELEASE_OUT).$(VER) |
---|
| 429 | ln -fs lib$(PRJ_NAME).so.$(VER) $@ |
---|
| 430 | # |
---|
| 431 | # create dynamic release out |
---|
| 432 | $(DYN_RELEASE_OUT).$(VER): $(RELEASE_OBJS) |
---|
| 433 | $(LD) $(LDFLAGS) $(RELEASE_LDFLAGS) -o $@ $(RELEASE_OBJS) -L$(LIB_DIR) $(USER_LIB_DIRS) $(LIBS) $(RELEASE_LIBS) $(DYN_LIBS) $(DYN_RELEASE_LIBS) |
---|
| 434 | # |
---|
| 435 | # |
---|
| 436 | # |
---|
| 437 | # |
---|
| 438 | # |
---|
| 439 | else |
---|
| 440 | ifeq ($(CONFIG), CONSOLE) |
---|
| 441 | # |
---|
| 442 | # added linked libraries to target prerequisites - $(*_PREREQS) variables - to force relinking when libraries have been rebuilt |
---|
| 443 | # 2005-01-25 Steffen Kamp (kamp@ient.rwth-aachen.de), RWTH Aachen |
---|
| 444 | # |
---|
| 445 | # create static debug out |
---|
| 446 | $(STAT_DEBUG_OUT): $(DEBUG_OBJS) $(STAT_DEBUG_PREREQS) |
---|
| 447 | $(LD) -o $@ $(LDFLAGS) $(DEBUG_LDFLAGS) $(DEBUG_OBJS) -L$(LIB_DIR) $(USER_LIB_DIRS) $(LIBS) $(DEBUG_LIBS) $(STAT_LIBS) $(STAT_DEBUG_LIBS) |
---|
| 448 | # |
---|
| 449 | # |
---|
| 450 | # create static release out |
---|
| 451 | $(STAT_RELEASE_OUT): $(RELEASE_OBJS) $(STAT_RELEASE_PREREQS) |
---|
| 452 | $(LD) -o $@ $(LDFLAGS) $(RELEASE_LDFLAGS) $(RELEASE_OBJS) -L$(LIB_DIR) $(USER_LIB_DIRS) $(LIBS) $(RELEASE_LIBS) $(STAT_LIBS) $(STAT_RELEASE_LIBS) |
---|
| 453 | # |
---|
| 454 | # |
---|
| 455 | # create dynamic debug out |
---|
| 456 | $(DYN_DEBUG_OUT): $(DEBUG_OBJS) $(DYN_DEBUG_PREREQS) |
---|
| 457 | $(LD) -o $@ $(LDFLAGS) $(DEBUG_LDFLAGS) $(DEBUG_OBJS) -L$(LIB_DIR) $(USER_LIB_DIRS) $(LIBS) $(DEBUG_LIBS) $(DYN_LIBS) $(DYN_DEBUG_LIBS) |
---|
| 458 | # |
---|
| 459 | # |
---|
| 460 | # create dynamic release out |
---|
| 461 | $(DYN_RELEASE_OUT): $(RELEASE_OBJS) $(DYN_RELEASE_PREREQS) |
---|
| 462 | $(LD) -o $@ $(LDFLAGS) $(RELEASE_LDFLAGS) $(RELEASE_OBJS) -L$(LIB_DIR) $(USER_LIB_DIRS) $(LIBS) $(RELEASE_LIBS) $(DYN_LIBS) $(DYN_RELEASE_LIBS) |
---|
| 463 | # |
---|
| 464 | # |
---|
| 465 | endif |
---|
| 466 | endif |
---|
| 467 | |
---|
| 468 | ########################################################## |
---|
| 469 | # delete all produced files |
---|
| 470 | ########################################################## |
---|
| 471 | |
---|
| 472 | clean: |
---|
| 473 | /bin/rm -rf $(STAT_DEBUG_OUT) |
---|
| 474 | /bin/rm -rf $(STAT_RELEASE_OUT) |
---|
| 475 | /bin/rm -rf $(DYN_DEBUG_OUT) |
---|
| 476 | /bin/rm -rf $(DYN_RELEASE_OUT) |
---|
| 477 | /bin/rm -rf $(OBJ_DIR) |
---|
| 478 | |
---|
| 479 | ifeq ($(CONFIG), LIBRARY) |
---|
| 480 | /bin/rm -rf $(DYN_DEBUG_OUT).$(VER) |
---|
| 481 | /bin/rm -rf $(DYN_RELEASE_OUT).$(VER) |
---|
| 482 | endif |
---|
| 483 | |
---|
| 484 | |
---|
| 485 | ########################################################## |
---|
| 486 | # include dependency files |
---|
| 487 | ########################################################## |
---|
| 488 | |
---|
| 489 | -include $(OBJS:.o=.d.P) |
---|
| 490 | -include $(OBJS:.o=.r.P) |
---|