Previous 199869 Revisions Next

r36765 Sunday 29th March, 2015 at 13:17:21 UTC by Miodrag Milanović
Separate OS and TARGETOS recognition and supported more platforms (nw)
[/trunk]makefile
[scripts]genie.lua

trunk/makefile
r245276r245277
1515#################   BEGIN USER-CONFIGURABLE OPTIONS   #####################
1616###########################################################################
1717
18ifdef TOOLS
19PARAMS+= --with-tools
18#
19# Determine running OS
20#
21
22ifeq ($(OS),Windows_NT)
23OS=windows
24GENIEOS=windows
25else
26UNAME = $(shell uname -mps)
27GENIEOS=linux
28ifeq ($(firstword $(filter Linux,$(UNAME))),Linux)
29OS = linux
2030endif
31ifeq ($(firstword $(filter Solaris,$(UNAME))),Solaris)
32OS = solaris
33endif
34ifeq ($(firstword $(filter FreeBSD,$(UNAME))),FreeBSD)
35OS = freebsd
36endif
37ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD)
38OS = freebsd
39endif
40ifeq ($(firstword $(filter NetBSD,$(UNAME))),NetBSD)
41OS = netbsd
42endif
43ifeq ($(firstword $(filter OpenBSD,$(UNAME))),OpenBSD)
44OS = openbsd
45endif
46ifeq ($(firstword $(filter Darwin,$(UNAME))),Darwin)
47OS=macosx
48GENIEOS=darwin
49DARWIN_VERSION = $(shell sw_vers -productVersion)
50endif
51ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku)
52OS = haiku
53endif
54ifndef OS
55$(error Unable to detect OS from uname -a: $(UNAME))
56endif
57endif
2158
2259#-------------------------------------------------
2360# specify core target: mame, mess, etc.
r245276r245277
3471SUBTARGET = $(TARGET)
3572endif
3673
37
38
39#-------------------------------------------------
40# specify OSD layer: windows, sdl, etc.
41# build rules will be included from
42# src/osd/$(OSD)/$(OSD).mak
43#-------------------------------------------------
44
45ifndef OSD
46ifeq ($(OS),Windows_NT)
47OSD = windows
48else
49OSD = sdl
50endif
51endif
52
5374CONFIG = release
5475ifdef DEBUG
5576CONFIG = debug
r245276r245277
6788
6889ifndef TARGETOS
6990
70ifeq ($(OS),Windows_NT)
71
91ifeq ($(OS),windows)
7292TARGETOS = windows
73OS=windows
7493WINDRES = windres
7594ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
76ARCHITECTURE = x64
95ARCHITECTURE =_x64
7796endif
7897ifeq ($(PROCESSOR_ARCHITECTURE),x86)
79ARCHITECTURE = x64
98ARCHITECTURE =_x64
8099ifeq ($(PROCESSOR_ARCHITEW6432),AMD64)
81100else
82ARCHITECTURE = x86
101ARCHITECTURE =_x86
83102endif
84103endif
85
86104else
87WINDRES=x86_64-w64-mingw32-windres
88UNAME = $(shell uname -mps)
89OS=linux
90ifeq ($(firstword $(filter Linux,$(UNAME))),Linux)
91TARGETOS = linux
92endif
93ifeq ($(firstword $(filter Solaris,$(UNAME))),Solaris)
94TARGETOS = solaris
95endif
96ifeq ($(firstword $(filter FreeBSD,$(UNAME))),FreeBSD)
97TARGETOS = freebsd
98endif
99ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD)
100TARGETOS = freebsd
101endif
102ifeq ($(firstword $(filter NetBSD,$(UNAME))),NetBSD)
103TARGETOS = netbsd
104endif
105ifeq ($(firstword $(filter OpenBSD,$(UNAME))),OpenBSD)
106TARGETOS = openbsd
107endif
108ifeq ($(firstword $(filter Darwin,$(UNAME))),Darwin)
109TARGETOS = macosx
110OS=darwin
111DARWIN_VERSION = $(shell sw_vers -productVersion)
112endif
113ifeq ($(firstword $(filter Haiku,$(UNAME))),Haiku)
114TARGETOS = haiku
115endif
105WINDRES  = x86_64-w64-mingw32-windres
106UNAME    = $(shell uname -mps)
107TARGETOS = $(OS)
116108
117ifndef TARGETOS
118$(error Unable to detect TARGETOS from uname -a: $(UNAME))
119endif
109ARCHITECTURE =_x86
120110
121ARCHITECTURE = x86
122
123111ifeq ($(firstword $(filter x86_64,$(UNAME))),x86_64)
124ARCHITECTURE = x64
112ARCHITECTURE =_x64
125113endif
126
127114ifeq ($(firstword $(filter amd64,$(UNAME))),amd64)
128ARCHITECTURE = x64
115ARCHITECTURE =_x64
129116endif
130
131117ifeq ($(firstword $(filter ppc64,$(UNAME))),ppc64)
132ARCHITECTURE = x64
118ARCHITECTURE =_x64
133119endif
134120endif
135121
r245276r245277
139125
140126ifdef PTR64
141127ifeq ($(PTR64),1)
142ARCHITECTURE = x64
128ARCHITECTURE =_x64
143129else
144ARCHITECTURE = x86
130ARCHITECTURE =_x86
145131endif
146132endif
147133
r245276r245277
151137LD = @g++
152138
153139#-------------------------------------------------
140# specify OSD layer: windows, sdl, etc.
141# build rules will be included from
142# src/osd/$(OSD)/$(OSD).mak
143#-------------------------------------------------
144
145ifndef OSD
146
147OSD = osdmini
148
149ifeq ($(TARGETOS),windows)
150OSD = windows
151endif
152
153ifeq ($(TARGETOS),linux)
154OSD = sdl
155endif
156
157ifeq ($(TARGETOS),macosx)
158OSD = sdl
159endif
160endif
161
162
163#-------------------------------------------------
154164# distribution may change things
155165#-------------------------------------------------
156166
r245276r245277
252262endif
253263endif
254264
265ifdef TOOLS
266PARAMS+= --with-tools
267endif
268
255269ifdef SYMBOLS
256270PARAMS+= --SYMBOLS=$(SYMBOLS)
257271endif
r245276r245277
353367ifeq ($(TARGETOS),macosx)
354368ifneq (,$(findstring 3.,$(CLANG_VERSION)))
355369ifeq ($(ARCHITECTURE),x64)
356ARCHITECTURE=x64_clang
370ARCHITECTURE=_x64_clang
357371else
358ARCHITECTURE=x86_clang
372ARCHITECTURE=_x86_clang
359373endif
360374endif
361375endif
r245276r245277
364378$(error Python is not available in path)
365379endif
366380
367GENIE=3rdparty/genie/bin/$(OS)/genie
381GENIE=3rdparty/genie/bin/$(GENIEOS)/genie
368382
369383SILENT?=@
370384
r245276r245277
374388SUBDIR = $(OSD)/$(TARGET)$(SUBTARGET)
375389endif
376390
377all: $(GENIE) $(TARGETOS)_$(ARCHITECTURE)
391all: $(GENIE) $(TARGETOS)$(ARCHITECTURE)
378392
379393windows_x64: generate
380394ifndef MINGW64
r245276r245277
385399endif
386400   $(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-mingw64-gcc config=$(CONFIG)64 WINDRES=$(WINDRES)
387401
402windows: windows_x86
403
388404windows_x86: generate
389405ifndef MINGW32
390406   $(error MINGW32 is not set)
r245276r245277
481497endif
482498   $(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-asmjs config=$(CONFIG)
483499
500
501nacl: nacl_x86
502
484503nacl_x64: generate
485504ifndef NACL_SDK_ROOT
486505   $(error NACL_SDK_ROOT is not set)
r245276r245277
523542endif
524543   $(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-linux config=$(CONFIG)64
525544
545linux: linux_x86
546
526547linux_x86: generate
527548ifndef COMPILE
528549   $(SILENT) $(GENIE) $(PARAMS) --gcc=linux-gcc --gcc_version=$(GCC_VERSION) gmake
r245276r245277
547568endif
548569   $(SILENT) $(MAKE) --no-print-directory -R -C build/projects/$(SUBDIR)/gmake-osx config=$(CONFIG)64
549570
571macosx: macosx_x86
572
550573macosx_x86: generate
551574ifndef COMPILE
552575   $(SILENT) $(GENIE) $(PARAMS) --gcc=osx --os_version=$(DARWIN_VERSION) --gcc_version=$(GCC_VERSION) gmake
r245276r245277
598621else
599622MOC_FILES=$(wildcard $(SRC)/osd/modules/debugger/qt/*.h)
600623
601ifeq ($(TARGETOS),windows)
624ifeq ($(OS),windows)
602625MOC = moc
603626ifneq ($(OSD),sdl)
604627MOC_FILES=
trunk/scripts/genie.lua
r245276r245277
6161   trigger = "targetos",
6262   description = "Choose target OS",
6363   allowed = {
64      { "android",   "Android"                },
65      { "asmjs",     "Emscripten/asm.js"      },
66      { "freebsd",   "FreeBSD"                },
67      { "linux",     "Linux"               },
68      { "ios",       "iOS"                    },
69      { "nacl",      "Native Client"          },
70      { "macosx",    "OSX"                    },
71      { "windows",   "Windows"                },
64      { "android-arm",   "Android - ARM"          },
65      { "android-mips",  "Android - MIPS"         },
66      { "android-x86",   "Android - x86"          },
67      { "asmjs",         "Emscripten/asm.js"      },
68      { "freebsd",       "FreeBSD"                },
69      { "nacl",          "Native Client"          },
70      { "nacl-arm",      "Native Client - ARM"    },
71      { "pnacl",         "Native Client - PNaCl"  },
72      { "linux",           "Linux"               },
73      { "ios",           "iOS"                    },
74      { "macosx",        "OSX"                    },
75      { "windows",       "Windows"                },
76
7277   },
7378}
7479


Previous 199869 Revisions Next


© 1997-2024 The MAME Team