#
# Author: Henrik Theiling
#
# @@Begin: Licencing and Copying@@
#
# Copyright (c) 1999 Henrik Theiling
#
# The term `this software' used in the following, additional to its
# usual usage, also includes the instantiated source files generated by
# tools from this package.
#
# This software is provided 'as-is', without warranty of any kind,
# express or implied.  In no event will the authors or copyright holders
# be held liable for any damages arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must
# not claim that you wrote the original software. If you use this
# software in a product, an acknowledgment in the product documentation
# would be appreciated but is not required.
#
# 2. Altered source versions must be plainly marked as such, and must
# not be misrepresented as being the original software.
#
# 3. You must not use any of the names of the authors or copyright
# holders of the original software for advertising or publicity
# pertaining to distribution without specific, written prior permission.
#
# 4. This notice may not be removed or altered from any source
# distribution.
#
# This licence is governed by the Laws of Germany.  Disputes shall be
# settled by Saarbruecken City Court.
#
# @@End: Licencing and Copying@@
#

VERSION=2.0.279-pre1

CC=wcl386
CXX=wcl386
LD=wcl386
AR=womp

# WRONG:
# TSORT and LORDER are not needed here: the MSVC++ linker determines
# the order itself.  This is the first positive thing I haveve ever
# learnt about this compiler <running to the calender marking today
# with a red pen>.  Hopefully I am right in thinking this... :-/
#
# No.
#
# Yes, the order does not seem to matter.  So far so good.  But the
# linker is not guaranteed to do it right.  It seems that it depends
# on the moon whether the initialisation order is correct.

CPPFLAGS=$(LESS_CPPFLAGS) -I../include -Iinclude -I.. /i=$(SUBDIR) /i=$(SUBDIR2) /i=$(SUBDIR3) \
         /dERWIN_DOS=1
         /dERWIN_COMPILING=1 \
         /dERWIN_WATCOM=1 \
          $(MORE_CPPFLAGS)
CXXFLAGS=$(LESS_CXXFLAGS)   $(MORE_CXXFLAGS)
CFLAGS=$(LESS_CFLAGS)   $(MORE_CFLAGS)

#EXT=.obj
#PREFIX=lib\
TARGETS= \
 lib\map_int_rgbcolour_p.obj lib\map_board_p_node_p.obj lib\map_int_char_p.obj \
 lib\vector_board_p.obj lib\vector_edge_p.obj lib\vector_node_p.obj \
 lib\vector_char_p.obj lib\vector_car_p.obj lib\map_int_int.obj lib\symtab.obj \
 lib\v_char.obj
SUBDIR=src
SUBDIR2=include
SUBDIR3=include

INIT_TARGETS=lib\init.obj
BASE_TARGETS=lib\map.obj lib\vector.obj lib\base.obj lib\list.obj
OBJECTS=$(INIT_TARGETS) $(TARGETS) $(BASE_TARGETS)

all: lib\erwin.lib

clean: dummy
	-del lib\erwin.lib $(OBJECTS)

lib\map.obj: lib\map.cpp
	$(CXX) @<<
lib\map.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\map.obj
	-move map.obj lib\map.obj

lib\init.obj: lib\init.cpp
	$(CXX) @<<
lib\init.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\init.obj
	-move init.obj lib\init.obj

lib\vector.obj: lib\vector.cpp
	$(CXX) @<<
lib\vector.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\vector.obj
	-move vector.obj lib\vector.obj

lib\list.obj: lib\list.cpp
	$(CXX) @<<
lib\list.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\list.obj
	-move list.obj lib\list.obj

lib\base.obj: lib\base.cpp
	$(CXX) @<<
lib\base.cpp $(CPPFLAGS) $(CXXFLAGS) /c /o lib\base.obj
<<
	-del lib\base.obj
	-move base.obj lib\base.obj

#RULE lib\%.obj: $(SUBDIR)\%.--SOURCE-ENDING--
#	--COMPILER-- @<<
#$< $(CPPFLAGS) --COMPILER-FLAGS-- /c
#<<
#	-del $@
#	-move %.obj $@
#
lib\map_board_p_node_p.obj: $(SUBDIR)\map_board_p_node_p.cpp
	$(CXX) @<<
$(SUBDIR)\map_board_p_node_p.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\map_board_p_node_p.obj
	-move map_board_p_node_p.obj lib\map_board_p_node_p.obj

lib\map_int_char_p.obj: $(SUBDIR)\map_int_char_p.cpp
	$(CXX) @<<
$(SUBDIR)\map_int_char_p.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\map_int_char_p.obj
	-move map_int_char_p.obj lib\map_int_char_p.obj

lib\map_int_rgbcolour_p.obj: $(SUBDIR)\map_int_rgbcolour_p.cpp
	$(CXX) @<<
$(SUBDIR)\map_int_rgbcolour_p.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\map_int_rgbcolour_p.obj
	-move map_int_rgbcolour_p.obj lib\map_int_rgbcolour_p.obj

lib\symtab.obj: $(SUBDIR)\symtab.cpp
	$(CXX) @<<
$(SUBDIR)\symtab.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\symtab.obj
	-move symtab.obj lib\symtab.obj

lib\vector_edge_p.obj: $(SUBDIR)\vector_edge_p.cpp
	$(CXX) @<<
$(SUBDIR)\vector_edge_p.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\vector_edge_p.obj
	-move vector_edge_p.obj lib\vector_edge_p.obj

lib\vector_car_p.obj: $(SUBDIR)\vector_car_p.cpp
	$(CXX) @<<
$(SUBDIR)\vector_car_p.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\vector_car_p.obj
	-move vector_car_p.obj lib\vector_car_p.obj

lib\v_char.obj: $(SUBDIR)\v_char.cpp
	$(CXX) @<<
$(SUBDIR)\v_char.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\v_char.obj
	-move v_char.obj lib\v_char.obj

lib\map_int_int.obj: $(SUBDIR)\map_int_int.cpp
	$(CXX) @<<
$(SUBDIR)\map_int_int.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\map_int_int.obj
	-move map_int_int.obj lib\map_int_int.obj

lib\vector_board_p.obj: $(SUBDIR)\vector_board_p.cpp
	$(CXX) @<<
$(SUBDIR)\vector_board_p.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\vector_board_p.obj
	-move vector_board_p.obj lib\vector_board_p.obj

lib\vector_node_p.obj: $(SUBDIR)\vector_node_p.cpp
	$(CXX) @<<
$(SUBDIR)\vector_node_p.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\vector_node_p.obj
	-move vector_node_p.obj lib\vector_node_p.obj

lib\vector_char_p.obj: $(SUBDIR)\vector_char_p.cpp
	$(CXX) @<<
$(SUBDIR)\vector_char_p.cpp $(CPPFLAGS) $(CXXFLAGS) /c
<<
	-del lib\vector_char_p.obj
	-move vector_char_p.obj lib\vector_char_p.obj

#END RULE

lib\erwin.lib: $(OBJECTS)
	-del lib\erwin.lib
	$(AR) @<<
/out:$@ $(OBJECTS)
<<

dummy:


