# TrueReality - Makefile
# Copyright (C) 1998 Niki W. Waibel
#
# This program is free software; you can redistribute it and/
# or modify it under the terms of the GNU General Public Li-
# cence as published by the Free Software Foundation; either
# version 2 of the Licence, or any later version.
#
# This program is distributed in the hope that it will be use-
# ful, but WITHOUT ANY WARRANTY; without even the implied war-
# ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public Licence for more details.
#
# You should have received a copy of the GNU General Public
# Licence along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
# USA.
#
# Information about me (the author):
#   Niki W. Waibel, Reichenau 20, 6890 Lustenau, Austria - EUROPE
#   niki.waibel@gmx.net





###############################################################################
# You shouldn't change anything in this file unless you are a developer.      #
# Changes can be done in 'Makefile.tmpl'.                                     #





.EXPORT_ALL_VARIABLES:





include Makefile.tmpl





VERSION = 1998112500
NAME    = TrueReality




CC      = $(CROSS_COMPILE)$(HOSTCC) $(HOSTCFLAGS)
CPP     = $(CROSS_COMPILE)$(HOSTCPP)
LD      = $(CROSS_COMPILE)$(HOSTLD)
AS      = $(CROSS_COMPILE)$(HOSTAS)
AR      = $(CROSS_COMPILE)$(HOSTAR)
RANLIB  = $(CROSS_COMPILE)$(HOSTRANLIB)
STRIP   = $(CROSS_COMPILE)$(HOSTSTRIP)





###############################################################################
# Machine (cpu) dependent definitions                                         #
###############################################################################
#                                                                             #
# hope that all of the following is ok - if not: email, thanks                #
#                                                                             #
###############################################################################

M_DEFS.alpha = -DALPHA -DENDIAN_IS_LITTLE
M_DEFS.i386  = -DI386 -DENDIAN_IS_LITTLE
M_DEFS.m68k  = -DM68K -DENDIAN_IS_BIG
M_DEFS.mips  = -DMIPS -DENDIAN_IS_BIG
M_DEFS.ppc   = -DPPC -DENDIAN_IS_BIG
M_DEFS.sparc = -DSPARC -DENDIAN_IS_BIG






###############################################################################
# Architecture (operating system) dependent definitions                       #
###############################################################################

# From: "Niki W. Waibel" <niki.waibel@gmx.net>
A_DEFS.linux    = -DLINUX
A_DEFS.freebsd  = -DFREEBSD
A_DEFS.netbsd   = -DNETBSD
A_DEFS.sunos    = -DSUNOS
A_DEFS.solaris  = -DSOLARIS
A_DEFS.aix      = -DAIX
# From: "William Sherman" <wsherman@ncsa.uiuc.edu>
A_DEFS.irix     = -DIRIX
A_DEFS.hpux     = -DHPUX
A_DEFS.ultrix   = -DULTRIX

# From: "Gil Pedersen" <gil@909mail.dk>
# Previously started by: "Richard Bannister"
A_DEFS.macos    = -DMACOS

# From: "KhTh" <explorer@websurf.pcom.de>
A_DEFS.os2      = -DOS2 -Zmtd -D__ST_MT_ERRNO__ -D__EMX__

A_DEFS.beos     = -DBEOS

A_DEFS.amigados = -DAMIGADOS

A_DEFS.msdos    = -DMSDOS
A_DEFS.win95    = -DWIN95
A_DEFS.win98    = -DWIN98
A_DEFS.winnt    = -DWINNT




###############################################################################
# Display dependent definitions                                               #
###############################################################################
#                                                                             #
# DISPLAY_SUPPORT (see 'config.h'):                                           #
#  %00000111 (binary number)                                                  #
#        |||__ local display                                                  #
#        ||___ local display process (display is a seperate thread/process)   #
#        |____ remote display (display can run on a different machine)        #
#                                                                             #
###############################################################################

D_DEFS.none             = -DDISPLAY_SUPPORT=0x00 -DDISPLAY=\"NONE\"
D_DEFS.x11              = -DDISPLAY_SUPPORT=0x01 -DDISPLAY=\"X11\"
D_DEFS.fb               = -DDISPLAY_SUPPORT=0x01 -DDISPLAY=\"FrameBuffer\"
D_DEFS.xf86_dga         = -DDISPLAY=\"X11 XF86_DGA\"
D_DEFS.svgalib          = -DDISPLAY=\"SVGALIB\"
D_DEFS.ggi              = -DDISPLAY=\"GGI\"
D_DEFS.ncurses          = -DDISPLAY=\"NCURSES\"
D_DEFS.mesa             = -DDISPLAY=\"X11 MESA\"

D_DEFS.macos            = -DDISPLAY=\"MACOS\"

D_DEFS.os2              = -DDISPLAY=\"OS2\"

D_DEFS.beos             = -DDISPLAY=\"BEOS\"

D_DEFS.amigados         = -DDISPLAY_SUPPORT=0x01 -DDISPLAY=\"AMIGADOS\"

D_DEFS.msdos            = -DDISPLAY=\"MSDOS\"
# is there a difference in the next 4 ones? or do they all use directx?
D_DEFS.win31            = -DDISPLAY=\"WIN31\"
D_DEFS.win95            = -DDISPLAY=\"WIN95\"
D_DEFS.win98            = -DDISPLAY=\"WIN98\"
D_DEFS.winnt            = -DDISPLAY=\"WINNT\"
D_DEFS.directx          = -DDISPLAY=\"DIRECTX\"
D_DEFS.opengl           = -DDISPLAY=\"OPENGL\"





###############################################################################
# Display dependent dependencies                                              #
###############################################################################

D_DEP.none             =
D_DEP.x11              = Display/local/X11/X11.o
D_DEP.fb               = Display/local/fb/fb.o
D_DEP.xf86_dga         = 
D_DEP.svgalib          = 
D_DEP.ggi              = 
D_DEP.ncurses          = 
D_DEP.mesa             = 

D_DEP.macos            = 

D_DEP.os2              = 

D_DEP.beos             = 

D_DEP.amigados         = Display/local/amigados/amigados.o

D_DEP.msdos            = 
# is there a difference in the next 4 ones? or do they all use directx?
D_DEP.win31            = 
D_DEP.win95            = 
D_DEP.win98            = 
D_DEP.winnt            = 
D_DEP.directx          = 
D_DEP.opengl           =





###############################################################################
# Architecture (operating system) dependent libraries/-paths                  #
###############################################################################

A_LIBS.linux    = -lm
A_LIBS.freebsd  =
A_LIBS.netbsd   =
A_LIBS.sunos    =
A_LIBS.solaris  =
A_LIBS.aix      =
A_LIBS.irix     =
A_LIBS.hpux     =
A_LIBS.ultrix   =

A_LIBS.macos    =

A_LIBS.os2      =

A_LIBS.beos     =

A_LIBS.amigados = -r -lm

A_LIBS.msdos    =
A_LIBS.win95    =
A_LIBS.win98    =
A_LIBS.winnt    =





###############################################################################
# Architecture (operating system) dependent include file pathes               #
###############################################################################

A_INCL.linux    = 
A_INCL.freebsd  =
A_INCL.netbsd   =
A_INCL.sunos    =
A_INCL.solaris  =
A_INCL.aix      =
A_INCL.irix     =
A_INCL.hpux     =
A_INCL.ultrix   =

A_INCL.macos    =

A_INCL.os2      =

A_INCL.beos     =

A_INCL.amigados = -I GG:ppc-amigaos/os-include/

A_INCL.msdos    =
A_INCL.win95    =
A_INCL.win98    =
A_INCL.winnt    =





include Makefile.objs





CFLAGS  = \
	$(OPTFLAGS) $(DBGFLAGS) \
	$(INLINE) $(SHM) \
	$(ZLIB) $(ZLIB_INCL) \
	$(COMP) \
	$(DBG) \
        $(FPS) \
	-DVERSION=\"$(VERSION)\" -DNAME=\"$(NAME)\" \
	$(M_DEFS.$(MACH)) $(A_DEFS.$(ARCH)) $(D_DEFS.$(DISP)) \
	$(A_INCL.$(ARCH)) \
	$(AD_CFLAGS.$(ARCH).$(DISP))

LIBS    = $(A_LIBS.$(ARCH)) $(AD_LIBS.$(ARCH).$(DISP)) $(ZLIB_DYN) $(ZLIB_STAT)



all: TrueReality



TrueReality: $(OBJCORE)
	$(LD) $(DBGFLAGS) -o ../$@.elf $(OBJCORE) $(LIBS)



%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $<



D_DEP.$(DISP).o: Display/local/$(DISP)/$(DISP).c
	$(MAKE) -C Display



#debug.o: debug.c
#	$(CC) $(CFLAGS) -o debug.o -c debug.c



#dispatch.o: dispatch.c
#	$(CC) $(CFLAGS) -o dispatch.o -c dispatch.c



#parser.o: parser.c
#	$(CC) $(CFLAGS) -o parser.o -c parser.c



#romimage.o: romimage.c
#	$(CC) $(CFLAGS) -o romimage.o -c romimage.c



#endian.o: endian.c
#	$(CC) $(CFLAGS) -o endian.o -c endian.c



#main.o: main.c
#	$(CC) $(CFLAGS) -o main.o -c main.c



clean:
	$(MAKE) -C IPC clean
	$(MAKE) -C Display clean
	$(MAKE) -C os clean
	$(MAKE) -C n64 clean
	$(RM) out
	$(RM) *.o
	$(RM) *.diff
	$(RM) TrueReality





