Previous 199869 Revisions Next

r23965 Thursday 27th June, 2013 at 01:26:05 UTC by R. Belmont
and again (nw)
[/branches/rbelmont]makefile*

branches/rbelmont/makefile
r0r23965
1###########################################################################
2#
3#   makefile
4#
5#   Core makefile for building MAME and derivatives
6#
7#   Copyright (c) Nicola Salmoria and the MAME Team.
8#   Visit http://mamedev.org for licensing and usage restrictions.
9#
10###########################################################################
11
12
13
14###########################################################################
15#################   BEGIN USER-CONFIGURABLE OPTIONS   #####################
16###########################################################################
17
18
19#-------------------------------------------------
20# specify core target: mame, mess, etc.
21# specify subtarget: mame, mess, tiny, etc.
22# build rules will be included from
23# src/$(TARGET)/$(SUBTARGET).mak
24#-------------------------------------------------
25
26ifndef TARGET
27TARGET = mame
28endif
29
30ifndef SUBTARGET
31SUBTARGET = $(TARGET)
32endif
33
34
35
36#-------------------------------------------------
37# specify OSD layer: windows, sdl, etc.
38# build rules will be included from
39# src/osd/$(OSD)/$(OSD).mak
40#-------------------------------------------------
41
42ifndef OSD
43ifeq ($(OS),Windows_NT)
44OSD = windows
45TARGETOS = win32
46else
47OSD = sdl
48endif
49endif
50
51ifndef CROSS_BUILD_OSD
52CROSS_BUILD_OSD = $(OSD)
53endif
54
55
56
57#-------------------------------------------------
58# specify OS target, which further differentiates
59# the underlying OS; supported values are:
60# win32, unix, macosx, os2
61#-------------------------------------------------
62
63ifndef TARGETOS
64
65ifeq ($(OS),Windows_NT)
66TARGETOS = win32
67else
68
69ifneq ($(CROSSBUILD),1)
70
71ifneq ($(OS2_SHELL),)
72TARGETOS = os2
73else
74
75UNAME = $(shell uname -a)
76
77ifeq ($(firstword $(filter Linux,$(UNAME))),Linux)
78TARGETOS = linux
79endif
80ifeq ($(firstword $(filter Solaris,$(UNAME))),Solaris)
81TARGETOS = solaris
82endif
83ifeq ($(firstword $(filter FreeBSD,$(UNAME))),FreeBSD)
84TARGETOS = freebsd
85endif
86ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD)
87TARGETOS = freebsd
88endif
89ifeq ($(firstword $(filter NetBSD,$(UNAME))),NetBSD)
90TARGETOS = netbsd
91endif
92ifeq ($(firstword $(filter OpenBSD,$(UNAME))),OpenBSD)
93TARGETOS = openbsd
94endif
95ifeq ($(firstword $(filter Darwin,$(UNAME))),Darwin)
96TARGETOS = macosx
97endif
98ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku)
99TARGETOS = haiku
100endif
101
102ifndef TARGETOS
103$(error Unable to detect TARGETOS from uname -a: $(UNAME))
104endif
105
106# Autodetect PTR64
107ifndef PTR64
108ifeq ($(firstword $(filter x86_64,$(UNAME))),x86_64)
109PTR64 = 1
110endif
111ifeq ($(firstword $(filter amd64,$(UNAME))),amd64)
112PTR64 = 1
113endif
114ifeq ($(firstword $(filter ppc64,$(UNAME))),ppc64)
115PTR64 = 1
116endif
117endif
118
119# Autodetect BIGENDIAN
120# MacOSX
121ifndef BIGENDIAN
122ifneq (,$(findstring Power,$(UNAME)))
123BIGENDIAN=1
124endif
125# Linux
126ifneq (,$(findstring ppc,$(UNAME)))
127BIGENDIAN=1
128endif
129endif # BIGENDIAN
130
131endif # OS/2
132endif # CROSS_BUILD
133endif # Windows_NT
134
135endif # TARGET_OS
136
137
138ifeq ($(TARGETOS),win32)
139
140# Autodetect PTR64
141ifndef PTR64
142ifneq (,$(findstring mingw64-w64,$(PATH)))
143PTR64=1
144endif
145endif
146
147endif
148
149
150
151#-------------------------------------------------
152# configure name of final executable
153#-------------------------------------------------
154
155# uncomment and specify prefix to be added to the name
156# PREFIX =
157
158# uncomment and specify suffix to be added to the name
159# SUFFIX =
160
161
162
163#-------------------------------------------------
164# specify architecture-specific optimizations
165#-------------------------------------------------
166
167# uncomment and specify architecture-specific optimizations here
168# some examples:
169#   ARCHOPTS = -march=pentiumpro  # optimize for I686
170#   ARCHOPTS = -march=core2       # optimize for Core 2
171#   ARCHOPTS = -march=native      # optimize for local machine (auto detect)
172#   ARCHOPTS = -mcpu=G4           # optimize for G4
173# note that we leave this commented by default so that you can
174# configure this in your environment and never have to think about it
175# ARCHOPTS =
176
177
178
179#-------------------------------------------------
180# specify program options; see each option below
181# for details
182#-------------------------------------------------
183
184# uncomment next line to build a debug version
185# DEBUG = 1
186
187# uncomment next line to include the internal profiler
188# PROFILER = 1
189
190# uncomment the force the universal DRC to always use the C backend
191# you may need to do this if your target architecture does not have
192# a native backend
193# FORCE_DRC_C_BACKEND = 1
194
195# uncomment next line to build using unix-style libsdl on Mac OS X
196# (vs. the native framework port).  Normal users should not enable this.
197# MACOSX_USE_LIBSDL = 1
198
199# uncomment and specify path to cppcheck executable to perform
200# static code analysis during compilation
201# CPPCHECK =
202
203
204
205#-------------------------------------------------
206# specify build options; see each option below
207# for details
208#-------------------------------------------------
209
210# uncomment next line if you are building for a 64-bit target
211# PTR64 = 1
212
213# uncomment next line if you are building for a big-endian target
214# BIGENDIAN = 1
215
216# uncomment next line to build expat as part of MAME build
217BUILD_EXPAT = 1
218
219# uncomment next line to build zlib as part of MAME build
220BUILD_ZLIB = 1
221
222# uncomment next line to build libflac as part of MAME build
223BUILD_FLAC = 1
224
225# uncomment next line to build jpeglib as part of MAME build
226BUILD_JPEGLIB = 1
227
228# uncomment next line to build PortMidi as part of MAME/MESS build
229BUILD_MIDILIB = 1
230
231# uncomment next line to include the symbols
232# SYMBOLS = 1
233
234# specify symbols level or leave commented to use the default
235# (default is SYMLEVEL = 2 normally; use 1 if you only need backtrace)
236# SYMLEVEL = 2
237
238# uncomment next line to dump the symbols to a .sym file
239# DUMPSYM = 1
240
241# uncomment next line to include profiling information from the compiler
242# PROFILE = 1
243
244# uncomment next line to generate a link map for exception handling in windows
245# MAP = 1
246
247# uncomment next line to generate verbose build information
248# VERBOSE = 1
249
250# specify the sanitizer to use or leave empty to use none
251# SANITIZE =
252
253# specify optimization level or leave commented to use the default
254# (default is OPTIMIZE = 3 normally, or OPTIMIZE = 0 with symbols)
255# OPTIMIZE = 3
256
257
258###########################################################################
259##################   END USER-CONFIGURABLE OPTIONS   ######################
260###########################################################################
261
262
263#-------------------------------------------------
264# sanity check the configuration
265#-------------------------------------------------
266
267# specify a default optimization level if none explicitly stated
268ifndef OPTIMIZE
269ifndef SYMBOLS
270OPTIMIZE = 3
271else
272OPTIMIZE = 0
273endif
274endif
275
276# profiler defaults to on for DEBUG builds
277ifdef DEBUG
278ifndef PROFILER
279PROFILER = 1
280endif
281endif
282
283# allow gprof profiling as well, which overrides the internal PROFILER
284# also enable symbols as it is useless without them
285ifdef PROFILE
286PROFILER =
287SYMBOLS = 1
288ifndef SYMLEVEL
289SYMLEVEL = 1
290endif
291endif
292
293# set the symbols level
294ifdef SYMBOLS
295ifndef SYMLEVEL
296SYMLEVEL = 2
297endif
298endif
299
300
301#-------------------------------------------------
302# platform-specific definitions
303#-------------------------------------------------
304
305# extension for executables
306EXE =
307
308ifeq ($(TARGETOS),win32)
309EXE = .exe
310endif
311ifeq ($(TARGETOS),os2)
312EXE = .exe
313endif
314
315ifndef BUILD_EXE
316BUILD_EXE = $(EXE)
317endif
318
319# compiler, linker and utilities
320AR = @ar
321CC = @gcc
322LD = @g++
323MD = -mkdir$(EXE)
324RM = @rm -f
325OBJDUMP = @objdump
326PYTHON = @python
327
328
329#-------------------------------------------------
330# form the name of the executable
331#-------------------------------------------------
332
333# reset all internal prefixes/suffixes
334PREFIXSDL =
335SUFFIX64 =
336SUFFIXDEBUG =
337SUFFIXPROFILE =
338
339# Windows SDL builds get an SDL prefix
340ifeq ($(OSD),sdl)
341ifeq ($(TARGETOS),win32)
342PREFIXSDL = sdl
343endif
344endif
345
346# 64-bit builds get a '64' suffix
347ifeq ($(PTR64),1)
348SUFFIX64 = 64
349endif
350
351# debug builds just get the 'd' suffix and nothing more
352ifdef DEBUG
353SUFFIXDEBUG = d
354endif
355
356# gprof builds get an addition 'p' suffix
357ifdef PROFILE
358SUFFIXPROFILE = p
359endif
360
361# the name is just 'target' if no subtarget; otherwise it is
362# the concatenation of the two (e.g., mametiny)
363ifeq ($(TARGET),$(SUBTARGET))
364NAME = $(TARGET)
365else
366NAME = $(TARGET)$(SUBTARGET)
367endif
368
369# fullname is prefix+name+suffix+suffix64+suffixdebug
370FULLNAME ?= $(PREFIX)$(PREFIXSDL)$(NAME)$(SUFFIX)$(SUFFIX64)$(SUFFIXDEBUG)$(SUFFIXPROFILE)
371
372# add an EXE suffix to get the final emulator name
373EMULATOR = $(FULLNAME)$(EXE)
374
375
376
377#-------------------------------------------------
378# source and object locations
379#-------------------------------------------------
380
381# all sources are under the src/ directory
382SRC = src
383
384# build the targets in different object dirs, so they can co-exist
385OBJ = obj/$(PREFIX)$(OSD)$(SUFFIX)$(SUFFIX64)$(SUFFIXDEBUG)$(SUFFIXPROFILE)
386
387
388
389#-------------------------------------------------
390# compile-time definitions
391#-------------------------------------------------
392
393# CR/LF setup: use both on win32/os2, CR only on everything else
394DEFS = -DCRLF=2
395
396ifeq ($(TARGETOS),win32)
397DEFS = -DCRLF=3
398endif
399ifeq ($(TARGETOS),os2)
400DEFS = -DCRLF=3
401endif
402
403# map the INLINE to something digestible by GCC
404DEFS += -DINLINE="static inline"
405
406# define LSB_FIRST if we are a little-endian target
407ifndef BIGENDIAN
408DEFS += -DLSB_FIRST
409endif
410
411# define PTR64 if we are a 64-bit target
412ifeq ($(PTR64),1)
413DEFS += -DPTR64
414endif
415
416# define MAME_DEBUG if we are a debugging build
417ifdef DEBUG
418DEFS += -DMAME_DEBUG
419else
420DEFS += -DNDEBUG
421endif
422
423# define MAME_PROFILER if we are a profiling build
424ifdef PROFILER
425DEFS += -DMAME_PROFILER
426endif
427
428# define USE_NETWORK if we are a making network enabled build
429ifdef USE_NETWORK
430DEFS += -DUSE_NETWORK
431endif
432
433# need to ensure FLAC functions are statically linked
434ifeq ($(BUILD_FLAC),1)
435DEFS += -DFLAC__NO_DLL
436endif
437
438# define USE_SYSTEM_JPEGLIB if library shipped with MAME is not used
439ifneq ($(BUILD_JPEGLIB),1)
440DEFS += -DUSE_SYSTEM_JPEGLIB
441endif
442
443
444
445#-------------------------------------------------
446# compile flags
447# CCOMFLAGS are common flags
448# CONLYFLAGS are flags only used when compiling for C
449# CPPONLYFLAGS are flags only used when compiling for C++
450# COBJFLAGS are flags only used when compiling for Objective-C(++)
451#-------------------------------------------------
452
453# start with empties for everything
454CCOMFLAGS =
455CONLYFLAGS =
456COBJFLAGS =
457CPPONLYFLAGS =
458
459# CFLAGS is defined based on C or C++ targets
460# (remember, expansion only happens when used, so doing it here is ok)
461CFLAGS = $(CCOMFLAGS) $(CPPONLYFLAGS)
462
463# we compile C-only to C89 standard with GNU extensions
464# we compile C++ code to C++98 standard with GNU extensions
465CONLYFLAGS += -std=gnu89
466CPPONLYFLAGS += -x c++ -std=gnu++98
467COBJFLAGS += -x objective-c++
468
469# this speeds it up a bit by piping between the preprocessor/compiler/assembler
470CCOMFLAGS += -pipe
471
472# add -g if we need symbols, and ensure we have frame pointers
473ifdef SYMBOLS
474CCOMFLAGS += -g$(SYMLEVEL) -fno-omit-frame-pointer
475endif
476
477# add -v if we need verbose build information
478ifdef VERBOSE
479CCOMFLAGS += -v
480endif
481
482# add profiling information for the compiler
483ifdef PROFILE
484CCOMFLAGS += -pg
485endif
486
487# add the optimization flag
488CCOMFLAGS += -O$(OPTIMIZE)
489
490# add the error warning flag
491ifndef NOWERROR
492CCOMFLAGS += -Werror
493endif
494
495# if we are optimizing, include optimization options
496ifneq ($(OPTIMIZE),0)
497CCOMFLAGS += -fno-strict-aliasing $(ARCHOPTS)
498endif
499
500# add a basic set of warnings
501CCOMFLAGS += \
502   -Wall \
503   -Wcast-align \
504   -Wundef \
505   -Wformat-security \
506   -Wwrite-strings \
507   -Wno-sign-compare \
508   -Wno-conversion
509
510# warnings only applicable to C compiles
511CONLYFLAGS += \
512   -Wpointer-arith \
513   -Wbad-function-cast \
514   -Wstrict-prototypes
515
516# warnings only applicable to OBJ-C compiles
517COBJFLAGS += \
518   -Wpointer-arith
519
520# warnings only applicable to C++ compiles
521CPPONLYFLAGS += \
522   -Woverloaded-virtual
523
524ifneq (,$(findstring clang,$(CC)))
525CCOMFLAGS += \
526   -Wno-cast-align \
527   -Wno-tautological-compare \
528   -Wno-constant-logical-operand \
529   -Wno-format-security \
530   -Wno-shift-count-overflow \
531   -Wno-self-assign-field
532endif
533
534ifdef SANITIZE
535CCOMFLAGS += -fsanitize=$(SANITIZE)
536ifneq (,$(findstring thread,$(SANITIZE)))
537CCOMFLAGS += -fPIE
538endif
539ifneq (,$(findstring memory,$(SANITIZE)))
540ifneq (,$(findstring clang,$(CC)))
541CCOMFLAGS += -fsanitize-memory-track-origins -fPIE
542endif
543endif
544endif
545
546#-------------------------------------------------
547# include paths
548#-------------------------------------------------
549
550# add core include paths
551INCPATH += \
552   -I$(SRC)/$(TARGET) \
553   -I$(OBJ)/$(TARGET)/layout \
554   -I$(SRC)/emu \
555   -I$(OBJ)/emu \
556   -I$(OBJ)/emu/layout \
557   -I$(SRC)/lib/util \
558   -I$(SRC)/lib \
559   -I$(SRC)/osd \
560   -I$(SRC)/osd/$(OSD) \
561
562
563
564#-------------------------------------------------
565# archiving flags
566#-------------------------------------------------
567# Default to something reasonable for all platforms
568ARFLAGS = -cr
569# Deal with macosx brain damage if COMMAND_MODE is in
570# the luser's environment:
571ifeq ($(TARGETOS),macosx)
572ifeq ($(COMMAND_MODE),"legacy")
573ARFLAGS = -crs
574endif
575endif
576
577
578#-------------------------------------------------
579# linking flags
580#-------------------------------------------------
581
582# LDFLAGS are used generally; LDFLAGSEMULATOR are additional
583# flags only used when linking the core emulator
584LDFLAGS =
585ifneq ($(TARGETOS),macosx)
586ifneq ($(TARGETOS),os2)
587ifneq ($(TARGETOS),solaris)
588LDFLAGS = -Wl,--warn-common
589endif
590endif
591endif
592LDFLAGSEMULATOR =
593
594# add profiling information for the linker
595ifdef PROFILE
596LDFLAGS += -pg
597endif
598
599# strip symbols and other metadata in non-symbols and non profiling builds
600ifndef SYMBOLS
601ifneq ($(TARGETOS),macosx)
602LDFLAGS += -s
603endif
604endif
605
606# output a map file (emulator only)
607ifdef MAP
608LDFLAGSEMULATOR += -Wl,-Map,$(FULLNAME).map
609endif
610
611ifdef SANITIZE
612LDFLAGS += -fsanitize=$(SANITIZE)
613ifneq (,$(findstring thread,$(SANITIZE)))
614LDFLAGS += -pie
615endif
616ifneq (,$(findstring memory,$(SANITIZE)))
617LDFLAGS += -pie
618endif
619endif
620
621
622#-------------------------------------------------
623# define the standard object directory; other
624# projects can add their object directories to
625# this variable
626#-------------------------------------------------
627
628OBJDIRS = $(OBJ) $(OBJ)/$(TARGET)/$(SUBTARGET)
629
630
631#-------------------------------------------------
632# define standard libarires for CPU and sounds
633#-------------------------------------------------
634
635LIBEMU = $(OBJ)/libemu.a
636LIBOPTIONAL = $(OBJ)/$(TARGET)/$(SUBTARGET)/liboptional.a
637LIBDASM = $(OBJ)/$(TARGET)/$(SUBTARGET)/libdasm.a
638LIBUTIL = $(OBJ)/libutil.a
639LIBOCORE = $(OBJ)/libocore.a
640LIBOSD = $(OBJ)/libosd.a
641
642VERSIONOBJ = $(OBJ)/version.o
643EMUINFOOBJ = $(OBJ)/$(TARGET)/$(TARGET).o
644DRIVLISTSRC = $(OBJ)/$(TARGET)/$(SUBTARGET)/drivlist.c
645DRIVLISTOBJ = $(OBJ)/$(TARGET)/$(SUBTARGET)/drivlist.o
646
647
648
649#-------------------------------------------------
650# either build or link against the included
651# libraries
652#-------------------------------------------------
653
654# start with an empty set of libs
655LIBS =
656
657# add expat XML library
658ifeq ($(BUILD_EXPAT),1)
659INCPATH += -I$(SRC)/lib/expat
660EXPAT = $(OBJ)/libexpat.a
661else
662LIBS += -lexpat
663EXPAT =
664endif
665
666# add ZLIB compression library
667ifeq ($(BUILD_ZLIB),1)
668INCPATH += -I$(SRC)/lib/zlib
669ZLIB = $(OBJ)/libz.a
670else
671LIBS += -lz
672ZLIB =
673endif
674
675# add flac library
676ifeq ($(BUILD_FLAC),1)
677INCPATH += -I$(SRC)/lib/util
678FLAC_LIB = $(OBJ)/libflac.a
679# $(OBJ)/libflac++.a
680else
681LIBS += -lFLAC
682FLAC_LIB =
683endif
684
685# add jpeglib image library
686ifeq ($(BUILD_JPEGLIB),1)
687INCPATH += -I$(SRC)/lib/libjpeg
688JPEG_LIB = $(OBJ)/libjpeg.a
689else
690LIBS += -ljpeg
691JPEG_LIB =
692endif
693
694# add SoftFloat floating point emulation library
695SOFTFLOAT = $(OBJ)/libsoftfloat.a
696
697# add formats emulation library
698FORMATS_LIB = $(OBJ)/libformats.a
699
700# add LUA library
701LUA_LIB = $(OBJ)/liblua.a
702
703# add PortMidi MIDI library
704ifeq ($(BUILD_MIDILIB),1)
705INCPATH += -I$(SRC)/lib/portmidi
706MIDI_LIB = $(OBJ)/libportmidi.a
707else
708LIBS += -lportmidi
709MIDI_LIB =
710endif
711
712ifneq (,$(findstring clang,$(CC)))
713LIBS += -lstdc++ -lpthread
714endif
715
716#-------------------------------------------------
717# 'default' target needs to go here, before the
718# include files which define additional targets
719#-------------------------------------------------
720
721default: maketree buildtools emulator
722
723all: default tools
724
7257Z_LIB = $(OBJ)/lib7z.a
726
727#-------------------------------------------------
728# defines needed by multiple make files
729#-------------------------------------------------
730
731BUILDSRC = $(SRC)/build
732BUILDOBJ = $(OBJ)/build
733BUILDOUT = $(BUILDOBJ)
734
735
736
737#-------------------------------------------------
738# include the various .mak files
739#-------------------------------------------------
740
741# include OSD-specific rules first
742include $(SRC)/osd/$(OSD)/$(OSD).mak
743
744# then the various core pieces
745include $(SRC)/build/build.mak
746include $(SRC)/$(TARGET)/$(SUBTARGET).mak
747-include $(SRC)/$(TARGET)/osd/$(OSD)/$(OSD).mak
748include $(SRC)/emu/emu.mak
749include $(SRC)/lib/lib.mak
750-include $(SRC)/osd/$(CROSS_BUILD_OSD)/build.mak
751include $(SRC)/tools/tools.mak
752include $(SRC)/regtests/regtests.mak
753
754# combine the various definitions to one
755CCOMFLAGS += $(INCPATH)
756CDEFS = $(DEFS)
757
758# TODO: -x c++ should not be hard-coded
759CPPCHECKFLAGS = $(CDEFS) $(INCPATH) -x c++ --enable=style
760
761
762#-------------------------------------------------
763# primary targets
764#-------------------------------------------------
765
766emulator: maketree $(BUILD) $(EMULATOR)
767
768buildtools: maketree $(BUILD)
769
770tools: maketree $(TOOLS)
771
772maketree: $(sort $(OBJDIRS))
773
774clean: $(OSDCLEAN)
775   @echo Deleting object tree $(OBJ)...
776   $(RM) -r $(OBJ)
777   @echo Deleting $(EMULATOR)...
778   $(RM) $(EMULATOR)
779   @echo Deleting $(TOOLS)...
780   $(RM) $(TOOLS)
781   @echo Deleting dependencies...
782   $(RM) depend_emu.mak
783   $(RM) depend_mame.mak
784   $(RM) depend_mess.mak
785   $(RM) depend_ume.mak
786ifdef MAP
787   @echo Deleting $(FULLNAME).map...
788   $(RM) $(FULLNAME).map
789endif
790ifdef SYMBOLS
791   @echo Deleting $(FULLNAME).sym...
792   $(RM) $(FULLNAME).sym
793endif
794
795checkautodetect:
796   @echo TARGETOS=$(TARGETOS)
797   @echo PTR64=$(PTR64)
798   @echo BIGENDIAN=$(BIGENDIAN)
799   @echo UNAME="$(UNAME)"
800
801tests: $(REGTESTS)
802
803mak: maketree $(MAKEMAK_TARGET)
804   @echo Rebuilding $(SUBTARGET).mak...
805   $(MAKEMAK) $(SRC)/targets/$(SUBTARGET).lst -I$(SRC)/emu -I$(SRC)/mame -I$(SRC)/mame/layout -I$(SRC)/mess -I$(SRC)/mess/layout $(SRC) > $(SUBTARGET).mak
806   $(MAKEMAK) $(SRC)/targets/$(SUBTARGET).lst > $(SUBTARGET).lst
807
808#-------------------------------------------------
809# directory targets
810#-------------------------------------------------
811
812$(sort $(OBJDIRS)):
813   $(MD) -p $@
814
815
816
817#-------------------------------------------------
818# executable targets and dependencies
819#-------------------------------------------------
820
821ifndef EXECUTABLE_DEFINED
822
823$(EMULATOR): $(EMUINFOOBJ) $(DRIVLISTOBJ) $(DRVLIBS) $(LIBOSD) $(LIBOPTIONAL) $(LIBEMU) $(LIBDASM) $(LIBUTIL) $(EXPAT) $(SOFTFLOAT) $(JPEG_LIB) $(FLAC_LIB) $(7Z_LIB) $(FORMATS_LIB) $(LUA_LIB) $(ZLIB) $(LIBOCORE) $(MIDI_LIB) $(RESFILE)
824   $(CC) $(CDEFS) $(CFLAGS) -c $(SRC)/version.c -o $(VERSIONOBJ)
825   @echo Linking $@...
826   $(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $(VERSIONOBJ) $^ $(LIBS) -o $@
827ifeq ($(TARGETOS),win32)
828ifdef SYMBOLS
829ifndef MSVC_BUILD
830   $(OBJDUMP) --section=.text --line-numbers --syms --demangle $@ >$(FULLNAME).sym
831endif
832endif
833endif
834
835endif
836
837
838
839#-------------------------------------------------
840# generic rules
841#-------------------------------------------------
842
843$(OBJ)/%.o: $(SRC)/%.c | $(OSPREBUILD)
844   @echo Compiling $<...
845   $(CC) $(CDEFS) $(CFLAGS) -c $< -o $@
846ifdef CPPCHECK
847   @$(CPPCHECK) $(CPPCHECKFLAGS) $<
848endif
849
850$(OBJ)/%.o: $(OBJ)/%.c | $(OSPREBUILD)
851   @echo Compiling $<...
852   $(CC) $(CDEFS) $(CFLAGS) -c $< -o $@
853ifdef CPPCHECK
854   @$(CPPCHECK) $(CPPCHECKFLAGS) $<
855endif
856
857$(OBJ)/%.pp: $(SRC)/%.c | $(OSPREBUILD)
858   @echo Compiling $<...
859   $(CC) $(CDEFS) $(CFLAGS) -E $< -o $@
860ifdef CPPCHECK
861   @$(CPPCHECK) $(CPPCHECKFLAGS) $<
862endif
863
864$(OBJ)/%.s: $(SRC)/%.c | $(OSPREBUILD)
865   @echo Compiling $<...
866   $(CC) $(CDEFS) $(CFLAGS) -S $< -o $@
867ifdef CPPCHECK
868   @$(CPPCHECK) $(CPPCHECKFLAGS) $<
869endif
870
871$(OBJ)/%.lh: $(SRC)/%.lay $(FILE2STR_TARGET)
872   @echo Converting $<...
873   @$(FILE2STR) $< $@ layout_$(basename $(notdir $<))
874
875$(OBJ)/%.fh: $(SRC)/%.png $(PNG2BDC_TARGET) $(FILE2STR_TARGET)
876   @echo Converting $<...
877   @$(PNG2BDC) $< $(OBJ)/temp.bdc
878   @$(FILE2STR) $(OBJ)/temp.bdc $@ font_$(basename $(notdir $<)) UINT8
879
880$(DRIVLISTOBJ): $(DRIVLISTSRC)
881   @echo Compiling $<...
882   $(CC) $(CDEFS) $(CFLAGS) -c $< -o $@
883ifdef CPPCHECK
884   @$(CPPCHECK) $(CPPCHECKFLAGS) $<
885endif
886
887$(DRIVLISTSRC): $(SRC)/$(TARGET)/$(SUBTARGET).lst $(MAKELIST_TARGET)
888   @echo Building driver list $<...
889   @$(MAKELIST) $< >$@
890
891$(OBJ)/%.a:
892   @echo Archiving $@...
893   $(RM) $@
894   $(AR) $(ARFLAGS) $@ $^
895
896ifeq ($(TARGETOS),macosx)
897$(OBJ)/%.o: $(SRC)/%.m | $(OSPREBUILD)
898   @echo Objective-C compiling $<...
899   $(CC) $(CDEFS) $(COBJFLAGS) $(CCOMFLAGS) -c $< -o $@
900endif
901
902
903
904#-------------------------------------------------
905# optional dependencies file
906#-------------------------------------------------
907
908-include depend_emu.mak
909-include depend_$(TARGET).mak
Property changes on: branches/rbelmont/makefile
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Previous 199869 Revisions Next


© 1997-2024 The MAME Team