##############################################################################
#   MAKEFILE - this file is part of Binary vIEW project (BIEW)               #
##############################################################################
#   Copyrights:           1998, 2000 Nick Kurshev                            #
#   License:              See below                                          #
#   Author and developer: Nick Kurshev                                       #
#   Requirement:          GNU make                                           #
#   Original file name:   makefile                                           #
####################### [ D e s c r i p t i o n ] ############################
#  This file is script for make utility of GNU development system.           #
########################### [ L i c e n c e ] ################################
# The Binary vIEW (BIEW) is copyright (C) 1995 Nick Kurshev.                 #
# All rights reserved.                                                       #
# This software is redistributable under the licence given in the file       #
# "Licence" distributed in the BIEW archive.                                 #
##############################################################################

##############################################################################
#  Main configure section of this makefile                                   #
##############################################################################
#
# Please select target platform. Valid values are:
# For 16-bit Intel: i86 i286 ( still is not supported by gcc )
# For 32-bit Intel
#           basic : i386 i486
#        extended : i586 i686 k6 athlon
#        for pgcc : i586mmx i686mmx k5 k6mmx 6x86 6x86mmx athlon_mmx
# For unknown     : generic
#-----------------------------------------------------------------------------
TARGET_PLATFORM=i386

# Please select target operation system. Valid values are:
# dos, os2, win32, linux, unix, beos
#---------------------------------------------------------
TARGET_OS=unix

# Please add any host specific flags here, if it need
# (like -fcall-used-R -fcall-saved-R -mrtd -mregparm=3 -mreg-alloc=  e.t.c ;-):
#------------------------------------------------------------------------------
# Notes: You can also define -D__EXPERIMENTAL_VERSION flag, if you want to
# build experimental version with fastcall technology.
HOST_CFLAGS=

# Please add any host specific linker flags here, if it need
#------------------------------------------------------------------------------
HOST_LDFLAGS=

###########################################################################
# You can fine tune the project for Unix platforms. For detail see unix.txt
# Please select screen library, that you want to use. Valid values are:
# vt100, slang, curses (default)
#--------------------------------------------------------------------------
TARGET_SCREEN_LIB = curses

# Please select if you want to use mouse. Valid values are:
# n(default), y
#----------------------------------------------------------
USE_MOUSE=n

# Please define if your OS has SELECT system call. Valid values are:
# n, y(default)
#-------------------------------------------------------------------
USE_SELECT=y

# You can select compilation level:
# max_debug  - To enable debugging, profiling, checking memory usage and more
# debug      - To enable debugging and profiling only
# normal     - Default for most platforms and gcc versions.
# advance    - Use it only for latest version of gcc
# master     - It only for developers ;-)
#----------------------------------------------------------------------
compilation=normal

# Happy hacking :)
##########################################################################

include ./makefile.inc

###########################################################################
# TARGET: put name of executable image here                               #
###########################################################################
TARGET = biew

##########################################################################
#                Please not modify contents below                        #
##########################################################################

INCS = -I.
LIBS = $(OS_LIBS)
OBJS = \
addendum.o\
bconsole.o\
biew.o\
biewhelp.o\
biewutil.o\
bin_util.o\
bmfile.o\
codeguid.o\
colorset.o\
dialogs.o\
editors.o\
events.o\
fileutil.o\
info_win.o\
mainloop.o\
mz_sys.o\
refs.o\
search.o\
setup.o\
sysinfo.o\
tstrings.o\
addons/sys/ascii.o\
addons/sys/consinfo.o\
addons/sys/cpu_perf.o\
addons/tools/dig_conv.o\
addons/tools/eval.o\
plugins/bin/aout.o\
plugins/bin/arch.o\
plugins/bin/bin.o\
plugins/bin/coff386.o\
plugins/bin/elf386.o\
plugins/bin/le.o\
plugins/bin/lx.o\
plugins/bin/ne.o\
plugins/bin/nlm386.o\
plugins/bin/opharlap.o\
plugins/bin/pe.o\
plugins/bin/pharlap.o\
plugins/bin/rdoff.o\
plugins/bin/rdoff2.o\
plugins/binmode.o\
plugins/disasm.o\
plugins/hexmode.o\
plugins/textmode.o\
plugins/nls/russian.o\
plugins/disasm/null_da.o\
plugins/disasm/ix86/ix86.o\
plugins/disasm/ix86/ix86_fpu.o\
plugins/disasm/ix86/ix86_fun.o\
biewlib/bbio.o\
biewlib/biewlib.o\
biewlib/file_ini.o\
biewlib/pmalloc.o\
biewlib/twin.o\
biewlib/sysdep/$(MACHINE)/cpu_info.o\
biewlib/sysdep/$(MACHINE)/$(HOST)/fileio.o\
biewlib/sysdep/$(MACHINE)/$(HOST)/keyboard.o\
biewlib/sysdep/$(MACHINE)/$(HOST)/mouse.o\
biewlib/sysdep/$(MACHINE)/$(HOST)/nls.o\
biewlib/sysdep/$(MACHINE)/$(HOST)/os_dep.o\
biewlib/sysdep/$(MACHINE)/$(HOST)/timer.o\
biewlib/sysdep/$(MACHINE)/$(HOST)/vio.o
all: $(TARGET)

clean:
	$(RM) $(OBJS)
	$(RM) $(TARGET)
	$(RM) biew.map

cleansys:
	$(RM) biewlib/sysdep/$(MACHINE)/$(HOST)/*.o

$(TARGET): $(OBJS)
	$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
%.o : %.c
ifeq ($(bad_os),yes)
	@echo Please select valid TARGET_OS
	@exit
endif
ifeq ($(bad_machine),yes)
	@echo Please select valid TARGET_MACHINE
	@exit
endif
	$(CC) $(CFLAGS) $(INCS) -c $< -o $@

addendum.o:                   addendum.c
bconsole.o:                   bconsole.c
biew.o:                       biew.c
biewhelp.o:                   biewhelp.c
biewutil.o:                   biewutil.c
bin_util.o:                   bin_util.c
bmfile.o:                     bmfile.c
codeguid.o:                   codeguid.c
colorset.o:                   colorset.c
dialogs.o:                    dialogs.c
editors.o:                    editors.c
events.o:                     events.c
fileutil.o:                   fileutil.c
info_win.o:                   info_win.c
mainloop.o:                   mainloop.c
mz_sys.o:                     mz_sys.c
refs.o:                       refs.c
search.o:                     search.c
setup.o:                      setup.c
sysinfo.o:                    sysinfo.c
tstrings.o:                   tstrings.c
addons/sys/ascii.o:           addons/sys/ascii.c
addons/sys/consinfo.o:        addons/sys/consinfo.c
addons/sys/cpu_perf.o:        addons/sys/cpu_perf.c
addons/tools/dig_conv.o:      addons/tools/dig_conv.c
addons/tools/eval.o:          addons/tools/eval.c
plugins/bin/aout.o:           plugins/bin/aout.c
plugins/bin/arch.o:           plugins/bin/arch.c
plugins/bin/bin.o:            plugins/bin/bin.c
plugins/bin/coff386.o:        plugins/bin/coff386.c
plugins/bin/elf386.o:         plugins/bin/elf386.c
plugins/bin/le.o:             plugins/bin/le.c
plugins/bin/lx.o:             plugins/bin/lx.c
plugins/bin/ne.o:             plugins/bin/ne.c
plugins/bin/nlm386.o:         plugins/bin/nlm386.c
plugins/bin/opharlap.o:       plugins/bin/opharlap.c
plugins/bin/pe.o:             plugins/bin/pe.c
plugins/bin/pharlap.o:        plugins/bin/pharlap.c
plugins/bin/rdoff.o:          plugins/bin/rdoff.c
plugins/bin/rdoff2.o:         plugins/bin/rdoff2.c
plugins/binmode.o:            plugins/binmode.c
plugins/disasm.o:             plugins/disasm.c
plugins/hexmode.o:            plugins/hexmode.c
plugins/textmode.o:           plugins/textmode.c
plugins/nls/russian.o:        plugins/nls/russian.c
plugins/disasm/null_da.o:     plugins/disasm/null_da.c
plugins/disasm/ix86/ix86.o:   plugins/disasm/ix86/ix86.c
plugins/disasm/ix86/ix86_fpu.o: plugins/disasm/ix86/ix86_fpu.c
plugins/disasm/ix86/ix86_fun.o: plugins/disasm/ix86/ix86_fun.c
biewlib/bbio.o:               biewlib/bbio.c
biewlib/biewlib.o:            biewlib/biewlib.c
biewlib/file_ini.o:           biewlib/file_ini.c
biewlib/pmalloc.o:            biewlib/pmalloc.c
biewlib/twin.o:               biewlib/twin.c
biewlib/sysdep/$(MACHINE)/cpu_info.o:         biewlib/sysdep/$(MACHINE)/cpu_info.c
biewlib/sysdep/$(MACHINE)/$(HOST)/fileio.o:   biewlib/sysdep/$(MACHINE)/$(HOST)/fileio.c
biewlib/sysdep/$(MACHINE)/$(HOST)/keyboard.o: biewlib/sysdep/$(MACHINE)/$(HOST)/keyboard.c
biewlib/sysdep/$(MACHINE)/$(HOST)/mouse.o:    biewlib/sysdep/$(MACHINE)/$(HOST)/mouse.c
biewlib/sysdep/$(MACHINE)/$(HOST)/nls.o:      biewlib/sysdep/$(MACHINE)/$(HOST)/nls.c
biewlib/sysdep/$(MACHINE)/$(HOST)/os_dep.o:   biewlib/sysdep/$(MACHINE)/$(HOST)/os_dep.c
biewlib/sysdep/$(MACHINE)/$(HOST)/timer.o:    biewlib/sysdep/$(MACHINE)/$(HOST)/timer.c
biewlib/sysdep/$(MACHINE)/$(HOST)/vio.o:      biewlib/sysdep/$(MACHINE)/$(HOST)/vio.c
