Lines 330-343
Link Here
|
330 |
|
330 |
|
331 |
# compiler, linker and utilities |
331 |
# compiler, linker and utilities |
332 |
ifneq ($(TARGETOS),emscripten) |
332 |
ifneq ($(TARGETOS),emscripten) |
333 |
AR = @ar |
333 |
AR ?= @ar |
334 |
CC = @gcc |
334 |
CC ?= @gcc |
335 |
LD = @g++ |
335 |
CXX ?= @g++ |
|
|
336 |
LD = $(CXX) |
336 |
endif |
337 |
endif |
337 |
MD = -mkdir$(EXE) |
338 |
MD = -mkdir$(EXE) |
338 |
RM = @rm -f |
339 |
RM = @rm -f |
339 |
OBJDUMP = @objdump |
340 |
OBJDUMP = @objdump |
340 |
PYTHON = @python |
341 |
PYTHON ?= @python |
|
|
342 |
PKG_CONFIG ?= pkg-config |
341 |
|
343 |
|
342 |
|
344 |
|
343 |
#------------------------------------------------- |
345 |
#------------------------------------------------- |
Lines 480-486
Link Here
|
480 |
|
482 |
|
481 |
# CFLAGS is defined based on C or C++ targets |
483 |
# CFLAGS is defined based on C or C++ targets |
482 |
# (remember, expansion only happens when used, so doing it here is ok) |
484 |
# (remember, expansion only happens when used, so doing it here is ok) |
483 |
CFLAGS = $(CCOMFLAGS) $(CPPONLYFLAGS) |
485 |
CFLAGS += $(CCOMFLAGS) $(CPPONLYFLAGS) |
484 |
|
486 |
|
485 |
# we compile C-only to C89 standard with GNU extensions |
487 |
# we compile C-only to C89 standard with GNU extensions |
486 |
# we compile C++ code to C++98 standard with GNU extensions |
488 |
# we compile C++ code to C++98 standard with GNU extensions |
Lines 488-496
Link Here
|
488 |
CPPONLYFLAGS += -x c++ -std=gnu++98 |
490 |
CPPONLYFLAGS += -x c++ -std=gnu++98 |
489 |
COBJFLAGS += -x objective-c++ |
491 |
COBJFLAGS += -x objective-c++ |
490 |
|
492 |
|
491 |
# this speeds it up a bit by piping between the preprocessor/compiler/assembler |
|
|
492 |
CCOMFLAGS += -pipe |
493 |
|
494 |
# add -g if we need symbols, and ensure we have frame pointers |
493 |
# add -g if we need symbols, and ensure we have frame pointers |
495 |
ifdef SYMBOLS |
494 |
ifdef SYMBOLS |
496 |
CCOMFLAGS += -g$(SYMLEVEL) -fno-omit-frame-pointer |
495 |
CCOMFLAGS += -g$(SYMLEVEL) -fno-omit-frame-pointer |
Lines 512-533
Link Here
|
512 |
CCOMFLAGS += -pg |
511 |
CCOMFLAGS += -pg |
513 |
endif |
512 |
endif |
514 |
|
513 |
|
515 |
# add the optimization flag |
|
|
516 |
CCOMFLAGS += -O$(OPTIMIZE) |
517 |
|
518 |
# add the error warning flag |
519 |
ifndef NOWERROR |
520 |
CCOMFLAGS += -Werror |
521 |
endif |
522 |
|
523 |
# if we are optimizing, include optimization options |
524 |
ifneq ($(OPTIMIZE),0) |
525 |
CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS) |
526 |
ifdef LTO |
527 |
CCOMFLAGS += -flto |
528 |
endif |
529 |
endif |
530 |
|
531 |
# add a basic set of warnings |
514 |
# add a basic set of warnings |
532 |
CCOMFLAGS += \ |
515 |
CCOMFLAGS += \ |
533 |
-Wall \ |
516 |
-Wall \ |
Lines 613-642
Link Here
|
613 |
# linking flags |
596 |
# linking flags |
614 |
#------------------------------------------------- |
597 |
#------------------------------------------------- |
615 |
|
598 |
|
616 |
# LDFLAGS are used generally; LDFLAGSEMULATOR are additional |
|
|
617 |
# flags only used when linking the core emulator |
618 |
LDFLAGS = |
619 |
ifneq ($(TARGETOS),macosx) |
620 |
ifneq ($(TARGETOS),os2) |
621 |
ifneq ($(TARGETOS),solaris) |
622 |
LDFLAGS = -Wl,--warn-common |
623 |
endif |
624 |
endif |
625 |
endif |
626 |
LDFLAGSEMULATOR = |
627 |
|
628 |
# add profiling information for the linker |
599 |
# add profiling information for the linker |
629 |
ifdef PROFILE |
600 |
ifdef PROFILE |
630 |
LDFLAGS += -pg |
601 |
LDFLAGS += -pg |
631 |
endif |
602 |
endif |
632 |
|
603 |
|
633 |
# strip symbols and other metadata in non-symbols and non profiling builds |
|
|
634 |
ifndef SYMBOLS |
635 |
ifneq ($(TARGETOS),macosx) |
636 |
LDFLAGS += -s |
637 |
endif |
638 |
endif |
639 |
|
640 |
ifneq ($(OPTIMIZE),0) |
604 |
ifneq ($(OPTIMIZE),0) |
641 |
ifdef LTO |
605 |
ifdef LTO |
642 |
LDFLAGS += -flto |
606 |
LDFLAGS += -flto |
643 |
-- a/src/osd/sdl/sdl.mak |
607 |
++ b/src/osd/sdl/sdl.mak |
Lines 24-29
Link Here
|
24 |
# uncomment and edit next line to specify a distribution |
24 |
# uncomment and edit next line to specify a distribution |
25 |
# supported debian-stable, ubuntu-intrepid |
25 |
# supported debian-stable, ubuntu-intrepid |
26 |
|
26 |
|
|
|
27 |
PKG_CONFIG ?= pkg-config |
28 |
|
27 |
# DISTRO = debian-stable |
29 |
# DISTRO = debian-stable |
28 |
# DISTRO = ubuntu-intrepid |
30 |
# DISTRO = ubuntu-intrepid |
29 |
# DISTRO = gcc44-generic |
31 |
# DISTRO = gcc44-generic |
Lines 89-97
SDL_LIBVER = sdl
Link Here
|
89 |
endif |
89 |
endif |
90 |
|
90 |
|
91 |
ifdef SDL_INSTALL_ROOT |
91 |
ifdef SDL_INSTALL_ROOT |
92 |
SDL_CONFIG = $(SDL_INSTALL_ROOT)/bin/$(SDL_LIBVER)-config |
92 |
SDL_CONFIG ?= $(SDL_INSTALL_ROOT)/bin/$(SDL_LIBVER)-config |
93 |
else |
93 |
else |
94 |
SDL_CONFIG = $(SDL_LIBVER)-config |
94 |
SDL_CONFIG ?= $(SDL_LIBVER)-config |
95 |
endif |
95 |
endif |
96 |
|
96 |
|
97 |
ifeq ($(SDL_LIBVER),sdl2) |
97 |
ifeq ($(SDL_LIBVER),sdl2) |
Lines 188-195
SYNC_IMPLEMENTATION = tc
Link Here
|
188 |
SDL_NETWORK = taptun |
188 |
SDL_NETWORK = taptun |
189 |
|
189 |
|
190 |
ifndef NO_USE_MIDI |
190 |
ifndef NO_USE_MIDI |
191 |
INCPATH += `pkg-config --cflags alsa` |
191 |
INCPATH += $(shell $(PKG_CONFIG) --cflags alsa) |
192 |
LIBS += `pkg-config --libs alsa` |
192 |
LIBS += $(shell $(PKG_CONFIG) --libs alsa) |
193 |
endif |
193 |
endif |
194 |
|
194 |
|
195 |
endif |
195 |
endif |
196 |
|
196 |
|
Lines 497-509
Link Here
|
497 |
# Compile using installed libSDL (Fink or MacPorts): |
497 |
# Compile using installed libSDL (Fink or MacPorts): |
498 |
# |
498 |
# |
499 |
# Remove the "/SDL" component from the include path so that we can compile |
499 |
# Remove the "/SDL" component from the include path so that we can compile |
500 |
|
|
|
501 |
# files (header files are #include "SDL/something.h", so the extra "/SDL" |
500 |
# files (header files are #include "SDL/something.h", so the extra "/SDL" |
502 |
# causes a significant problem) |
501 |
# causes a significant problem) |
503 |
INCPATH += `sdl-config --cflags | sed 's:/SDL::'` |
502 |
INCPATH += $(shell $(SDL_CONFIG) --cflags | sed 's:/SDL::') |
504 |
CCOMFLAGS += -DNO_SDL_GLEXT |
503 |
CCOMFLAGS += -DNO_SDL_GLEXT |
505 |
# Remove libSDLmain, as its symbols conflict with SDLMain_tmpl.m |
504 |
# Remove libSDLmain, as its symbols conflict with SDLMain_tmpl.m |
506 |
LIBS += `sdl-config --libs | sed 's/-lSDLmain//'` -lpthread |
505 |
LIBS += $(shell $(SDL_CONFIG) --libs | sed 's/-lSDLmain//') -lpthread |
507 |
DEFS += -DMACOSX_USE_LIBSDL |
506 |
DEFS += -DMACOSX_USE_LIBSDL |
508 |
endif # MACOSX_USE_LIBSDL |
507 |
endif # MACOSX_USE_LIBSDL |
509 |
|
508 |
|
Lines 558-566
Link Here
|
558 |
endif |
558 |
endif |
559 |
|
559 |
|
560 |
ifneq ($(TARGETOS),emscripten) |
560 |
ifneq ($(TARGETOS),emscripten) |
561 |
INCPATH += `pkg-config --cflags fontconfig` |
561 |
INCPATH += $(shell $(PKG_CONFIG) --cflags fontconfig) |
562 |
endif |
562 |
endif |
563 |
LIBS += `pkg-config --libs fontconfig` |
563 |
LIBS += $(shell $(PKG_CONFIG) --libs fontconfig) |
564 |
|
564 |
|
565 |
ifeq ($(SDL_LIBVER),sdl2) |
565 |
ifeq ($(SDL_LIBVER),sdl2) |
566 |
#LIBS += -lSDL2_ttf |
566 |
#LIBS += -lSDL2_ttf |
Lines 647-654
Link Here
|
647 |
|
647 |
|
648 |
ifeq ($(BASE_TARGETOS),os2) |
648 |
ifeq ($(BASE_TARGETOS),os2) |
649 |
|
649 |
|
650 |
INCPATH += `sdl-config --cflags` |
650 |
INCPATH += $(shell $(SDL_CONFIG) --cflags) |
651 |
LIBS += `sdl-config --libs` -lpthread |
651 |
LIBS += $(shell $(SDL_CONFIG) --libs) |
652 |
|
652 |
|
653 |
endif # OS2 |
653 |
endif # OS2 |
654 |
|
654 |
|
Lines 657-666
Link Here
|
657 |
#------------------------------------------------- |
657 |
#------------------------------------------------- |
658 |
|
658 |
|
659 |
ifndef NO_USE_QTDEBUG |
659 |
ifndef NO_USE_QTDEBUG |
660 |
$(SDLOBJ)/%.moc.c: $(SDLSRC)/%.h |
|
|
661 |
$(MOC) $(MOCINCPATH) $(DEFS) $< -o $@ |
662 |
|
660 |
|
663 |
DEBUGOBJS = \ |
661 |
INCPATH += $(shell $(PKG_CONFIG) QtGui --cflags) |
|
|
662 |
LIBS += $(shell $(PKG_CONFIG) QtGui --libs) |
663 |
|
664 |
#$(SDLOBJ)/%.moc.c: $(SDLSRC)/%.h |
665 |
# $(MOC) $(MOCINCPATH) $(DEFS) $< -o $@ |
666 |
|
667 |
#DEBUGOBJS = \ |
664 |
$(SDLOBJ)/debugqt.o \ |
668 |
$(SDLOBJ)/debugqt.o \ |
665 |
$(SDLOBJ)/debugqtview.o \ |
669 |
$(SDLOBJ)/debugqtview.o \ |
666 |
$(SDLOBJ)/debugqtwindow.o \ |
670 |
$(SDLOBJ)/debugqtwindow.o \ |