summaryrefslogtreecommitdiffstatshomepage
path: root/src/build
diff options
context:
space:
mode:
author Couriersud <couriersud@users.noreply.github.com>2008-02-21 23:53:29 +0000
committer Couriersud <couriersud@users.noreply.github.com>2008-02-21 23:53:29 +0000
commit9c460a624831ee632aacf5c691039d4b7cc59151 (patch)
treef4eb3d25830eb0810f98717c6f807fd04db1743d /src/build
parent885d66e31a83d4d18b2337d73b69e1e2d56553fc (diff)
Makefile & build system update:
* verinfo: New syntax. verinfo now uses the following syntax: verinfo.exe -b windows|winui|mess. Does not depend on compile time defines any longer. * makefile will include - if it exists - src/osd/$(CROSS_BUILD_OSD)/build.mak. This was necessary to enable cross builds for winui. winui adds mkhelp to build tools and the rules for mkhelp thus had to be moved outside src/osd/winui/winui.mak * Tested on Linux 64bit, Linux 32bit, Windows 32bit mingw, Windows 32bit MSVC * Cross build environment to be posted to the list
Diffstat (limited to 'src/build')
-rw-r--r--src/build/build.mak11
-rw-r--r--src/build/verinfo.c116
2 files changed, 85 insertions, 42 deletions
diff --git a/src/build/build.mak b/src/build/build.mak
index d7c1a001a09..de333e56930 100644
--- a/src/build/build.mak
+++ b/src/build/build.mak
@@ -9,11 +9,6 @@
#
###########################################################################
-
-BUILDSRC = $(SRC)/build
-BUILDOBJ = $(OBJ)/build
-BUILDOUT = $(BUILDOBJ)
-
OBJDIRS += \
$(BUILDOBJ) \
@@ -23,8 +18,10 @@ OBJDIRS += \
# set of build targets
#-------------------------------------------------
-FILE2STR = $(BUILDOUT)/file2str$(EXE)
-PNG2BDC = $(BUILDOUT)/png2bdc$(EXE)
+FILE2STR = $(BUILDOUT)/file2str$(BUILD_EXE)
+PNG2BDC = $(BUILDOUT)/png2bdc$(BUILD_EXE)
+VERINFO = $(BUILDOUT)/verinfo$(BUILD_EXE)
+
VERINFO = $(BUILDOUT)/verinfo$(EXE)
ifneq ($(CROSS_BUILD),1)
diff --git a/src/build/verinfo.c b/src/build/verinfo.c
index e737120dff4..99621f691fc 100644
--- a/src/build/verinfo.c
+++ b/src/build/verinfo.c
@@ -13,7 +13,10 @@
#include <string.h>
#include <stdlib.h>
-#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))
+#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))
+#define BUILD_WINDOWS (0)
+#define BUILD_WINUI (1)
+#define BUILD_MESS (2)
//============================================================
// TYPE DEFINITIONS
@@ -40,6 +43,13 @@ struct _version_info
//============================================================
+// STATIC
+//============================================================
+
+static int build;
+
+
+//============================================================
// emit_version_info
//============================================================
@@ -160,6 +170,16 @@ static int parse_version(char *str, int *version_major, int *version_minor, int
//============================================================
// main
//============================================================
+static int usage(char *me)
+{
+ fprintf(stderr, "Usage: %s [-b windows|winui|mess] <filename>\n", me);
+ return 1;
+}
+
+
+//============================================================
+// main
+//============================================================
int main(int argc, char *argv[])
{
@@ -167,22 +187,43 @@ int main(int argc, char *argv[])
char legal_copyright[512];
char *buffer;
size_t size;
+ int opt;
FILE *f;
memset(&v, 0, sizeof(v));
-
+ build = BUILD_WINDOWS;
+
// validate parameters
- if (argc < 2)
+ opt = 1;
+ while (opt < argc && *argv[opt] == '-')
+ {
+ if (!strcmp(argv[opt], "-b"))
+ {
+ char *p = argv[++opt];
+ if (!strcmp(p,"windows"))
+ build = BUILD_WINDOWS;
+ else if (!strcmp(p,"winui"))
+ build = BUILD_WINUI;
+ else if (!strcmp(p,"mess"))
+ build = BUILD_MESS;
+ else
+ return usage(argv[0]);
+ }
+ else
+ return usage(argv[0]);
+ opt++;
+ }
+
+ if (opt != argc-1 )
{
- printf("Usage: %s <filename>\n", argv[0]);
- return 0;
+ return usage(argv[0]);
}
// open the file
- f = fopen(argv[1], "rb");
+ f = fopen(argv[argc-1], "rb");
if (f == NULL)
{
- fprintf(stderr, "Error opening file %s\n", argv[1]);
+ fprintf(stderr, "Error opening file %s\n", argv[argc-1]);
return 1;
}
@@ -209,34 +250,39 @@ int main(int argc, char *argv[])
if (parse_version(buffer, &v.version_major, &v.version_minor, &v.version_build, &v.version_string))
return 1;
-#ifdef MESS
- // MESS
- v.author = "MESS Team";
- v.comments = "Multi Emulation Super System";
- v.company_name = "MESS Team";
- v.file_description = "Multi Emulation Super System";
- v.internal_name = "MESS";
- v.original_filename = "MESS";
- v.product_name = "MESS";
-#elif defined(WINUI)
- // MAMEUI
- v.author = "Christopher Kirmse and the MAMEUI team";
- v.comments = "Multiple Arcade Machine Emulator with GUI";
- v.company_name = "MAME Team";
- v.file_description = "Multiple Arcade Machine Emulator with GUI";
- v.internal_name = "MAMEUI";
- v.original_filename = "MAMEUI";
- v.product_name = "MAMEUI";
-#else
- // MAME
- v.author = "Nicola Salmoria and the MAME Team";
- v.comments = "Multiple Arcade Machine Emulator";
- v.company_name = "MAME Team";
- v.file_description = "Multiple Arcade Machine Emulator";
- v.internal_name = "MAME";
- v.original_filename = "MAME";
- v.product_name = "MAME";
-#endif
+ if (build == BUILD_MESS)
+ {
+ // MESS
+ v.author = "MESS Team";
+ v.comments = "Multi Emulation Super System";
+ v.company_name = "MESS Team";
+ v.file_description = "Multi Emulation Super System";
+ v.internal_name = "MESS";
+ v.original_filename = "MESS";
+ v.product_name = "MESS";
+ }
+ else if (build == BUILD_WINUI)
+ {
+ // MAMEUI
+ v.author = "Christopher Kirmse and the MAMEUI team";
+ v.comments = "Multiple Arcade Machine Emulator with GUI";
+ v.company_name = "MAME Team";
+ v.file_description = "Multiple Arcade Machine Emulator with GUI";
+ v.internal_name = "MAMEUI";
+ v.original_filename = "MAMEUI";
+ v.product_name = "MAMEUI";
+ }
+ else
+ {
+ // MAME
+ v.author = "Nicola Salmoria and the MAME Team";
+ v.comments = "Multiple Arcade Machine Emulator";
+ v.company_name = "MAME Team";
+ v.file_description = "Multiple Arcade Machine Emulator";
+ v.internal_name = "MAME";
+ v.original_filename = "MAME";
+ v.product_name = "MAME";
+ }
// build legal_copyright string
v.legal_copyright = legal_copyright;