(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
authortron
Mon, 15 Nov 2004 07:53:09 +0000
changeset 421 0b9bdcdfe0c5
parent 420 d3a089648ec3
child 422 4480c7221e2e
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
Makefile
makefiledir/Makefile.config_writer
makefiledir/Makefile.libdetection
--- a/Makefile	Sun Nov 14 23:36:19 2004 +0000
+++ b/Makefile	Mon Nov 15 07:53:09 2004 +0000
@@ -44,6 +44,7 @@
 # UNIX: building on *nix derivate (Linux, FreeBSD)
 # OSX: building on Mac OS X
 # MORPHOS: building on MorphOS
+# BEOS: building on BeOS
 #
 # Summary of library choice defines
 # WITH_ZLIB: savegames using zlib
@@ -330,6 +331,16 @@
 CDEFS += -DUNIX
 endif
 
+ifdef BEOS
+CDEFS += -DBEOS
+LDFLAGS += -lmidi -lbe
+ifdef WITH_NETWORK
+	ifdef BEOS_NET_SERVER
+	CDEFS += -DBEOS_NET_SERVER
+	endif
+endif
+endif
+
 # SDL config
 ifdef WITH_SDL
 CDEFS += -DWITH_SDL
@@ -493,7 +504,7 @@
 
 ### Sources
 
-ttd_SOURCES = \
+C_SOURCES = \
 	ai.c ai_build.c ai_new.c ai_pathfinder.c ai_shared.c aircraft_cmd.c \
 	aircraft_gui.c airport.c airport_gui.c aystar.c bridge_gui.c \
 	clear_cmd.c command.c console.c console_cmds.c disaster_cmd.c dock_gui.c dummy_land.c economy.c \
@@ -507,19 +518,24 @@
 	smallmap_gui.c sound.c sprite.c spritecache.c station_cmd.c station_gui.c \
 	strings.c subsidy_gui.c terraform_gui.c texteff.c town_cmd.c \
 	town_gui.c train_cmd.c train_gui.c tree_cmd.c ttd.c tunnelbridge_cmd.c \
-	unmovable_cmd.c vehicle.c vehicle_gui.c viewport.c water_cmd.c widget.c window.c \
+	unmovable_cmd.c vehicle.c vehicle_gui.c viewport.c water_cmd.c widget.c window.c
+CXX_SOURCES =
 
 ifdef WITH_SDL
-ttd_SOURCES += sdl.c
+C_SOURCES += sdl.c
 endif
 
 ifdef WIN32
-ttd_SOURCES += win32.c w32dm.c
+C_SOURCES += win32.c w32dm.c
 else
-ttd_SOURCES += extmidi.c unix.c
+C_SOURCES += extmidi.c unix.c
 endif
 
-ttd_OBJS = $(ttd_SOURCES:%.c=%.o)
+ttd_OBJS = $(C_SOURCES:%.c=%.o) $(CXX_SOURCES:%.cpp=%.o)
+
+ifdef BEOS
+CXX_SOURCES += bemidi.cpp
+endif
 
 ifdef WIN32
 # Resource file
@@ -527,8 +543,7 @@
 endif
 
 ifdef WITH_DIRECTMUSIC
-ttd_SOURCES += w32dm2.cpp
-ttd_OBJS += w32dm2.o
+CXX_SOURCES += w32dm2.cpp
 endif
 
 ttd_DEPS1 = $(foreach obj,$(ttd_OBJS),.deps/$(obj))
--- a/makefiledir/Makefile.config_writer	Sun Nov 14 23:36:19 2004 +0000
+++ b/makefiledir/Makefile.config_writer	Mon Nov 15 07:53:09 2004 +0000
@@ -76,12 +76,14 @@
 	$(call CONFIG_LINE,OSX:=$(OSX))
 	$(call CONFIG_LINE,FREEBSD:=$(FREEBSD))
 	$(call CONFIG_LINE,MORPHOS:=$(MORPHOS))
+	$(call CONFIG_LINE,BEOS:=$(BEOS))
 	$(call CONFIG_LINE,CYGWIN:=$(CYGWIN))
 	$(call CONFIG_LINE,MINGW:=$(MINGW))
 	$(call CONFIG_LINE,)	
 	
 	$(call CONFIG_LINE,\# misc)
 	$(call CONFIG_LINE,SDL-CONFIG:=$(SDL-CONFIG))
+	$(call CONFIG_LINE,BEOS_NET_SERVER:=$(BEOS_NET_SERVER))
 	$(call CONFIG_LINE,CONFIG_INCLUDED:=yes)
 	$(call CONFIG_LINE,PATH_SET:=$(PATH_SET))
 	$(call CONFIG_LINE,CONFIG_VERSION:=$(MAKEFILE_VERSION))
--- a/makefiledir/Makefile.libdetection	Sun Nov 14 23:36:19 2004 +0000
+++ b/makefiledir/Makefile.libdetection	Mon Nov 15 07:53:09 2004 +0000
@@ -28,6 +28,17 @@
 UNIX:=1
 endif
 
+# Automatically recognize if building on BeOS
+ifeq ($(shell uname), BeOS)
+BEOS:=1
+# BeOS uses UNIX setup too
+UNIX:=1
+# Except that in BeOS 5.0 we need to use net_server, not BONE networking
+ifeq ($(shell uname -r), 5.0)
+BEOS_NET_SERVER:=1
+endif
+endif
+
 # FreeBSD uses sdl11 instead of sdl
 ifdef FREEBSD
 SDL-CONFIG:=sdl11-config
@@ -77,4 +88,4 @@
 endif
 endif
 endif
-endif
\ No newline at end of file
+endif