# This is an automatically generated file; please do not edit it manually.
# Instead, run makefile_builder.sh from the parent directory.
# It may require a little tweaking. (paths)

# Where is Ultima 7 installed
U7PATH:=C:/Ultima7

# Base of the exult source
SRC:=../..

srcdir:=.

UCCDIR:=$(SRC)
UCC:=$(UCCDIR)/ucc.exe

EXPACKDIR:=$(SRC)
EXPACK:=$(EXPACKDIR)/expack.exe

bgkeyringdir:=$(U7PATH)/forgeofvirtue/mods

USECODE_OBJECTS :=	\
	src/headers/array_functions.uc	\
	src/headers/bg/bg_externals.uc	\
	src/headers/bg/bg_externals2.uc	\
	src/headers/bg/bg_gflags.uc	\
	src/headers/bg/bg_gflags2.uc	\
	src/headers/bg/bg_npcs.uc	\
	src/headers/bg/bg_shapes.uc	\
	src/headers/bg/bg_shapes2.uc	\
	src/headers/bg/bg_structs.uc	\
	src/headers/constants.uc	\
	src/headers/constants2.uc	\
	src/headers/functions.uc	\
	src/headers/functions2.uc	\
	src/headers/new_flags.uc	\
	src/headers/new_items.uc	\
	src/headers/new_shapes.uc	\
	src/headers/npcs.uc	\
	src/items/anvil.uc	\
	src/items/baby.uc	\
	src/items/bellows.uc	\
	src/items/blackrock_potion.uc	\
	src/items/blacksword.uc	\
	src/items/bottle.uc	\
	src/items/bucket.uc	\
	src/items/cloth.uc	\
	src/items/crown_jewels.uc	\
	src/items/dough.uc	\
	src/items/eternal_flames.uc	\
	src/items/firepit.uc	\
	src/items/fishingrod.uc	\
	src/items/food.uc	\
	src/items/gem_of_dispelling.uc	\
	src/items/hammer.uc	\
	src/items/key.uc	\
	src/items/keyring.uc	\
	src/items/kitchenitem.uc	\
	src/items/lens.uc	\
	src/items/magic_carpet.uc	\
	src/items/misc.uc	\
	src/items/orb_of_the_moons.uc	\
	src/items/plaque.uc	\
	src/items/pocketwatch.uc	\
	src/items/related_functions/arcadion_dialog.uc	\
	src/items/remote_viewers.uc	\
	src/items/rings.uc	\
	src/items/shears.uc	\
	src/items/shrines.uc	\
	src/items/spell_items.uc	\
	src/items/swordblank.uc	\
	src/items/torch.uc	\
	src/items/water_trough.uc	\
	src/items/well.uc	\
	src/items/wheat.uc	\
	src/items/zauriel_journal.uc	\
	src/misc/blacksmithing.uc	\
	src/misc/blacksmithing/constants.uc	\
	src/misc/blacksmithing/externs.uc	\
	src/misc/blacksmithing/functions.uc	\
	src/misc/codex_eggs.uc	\
	src/misc/fishing.uc	\
	src/misc/food_stuff.uc	\
	src/misc/food_stuff/constants.uc	\
	src/misc/food_stuff/eggs.uc	\
	src/misc/food_stuff/functions.uc	\
	src/misc/food_stuff/milking.uc	\
	src/misc/inn_key_eggs.uc	\
	src/misc/is_obj_blocked.uc	\
	src/misc/iteractions.uc	\
	src/misc/rest_functions.uc	\
	src/misc/services.uc	\
	src/misc/shearing.uc	\
	src/misc/shearing/constants.uc	\
	src/misc/shearing/functions.uc	\
	src/monsters/chicken.uc	\
	src/monsters/fish.uc	\
	src/monsters/sheep.uc	\
	src/npcs/camille.uc	\
	src/npcs/chantu.uc	\
	src/npcs/csil.uc	\
	src/npcs/elad.uc	\
	src/npcs/gordon.uc	\
	src/npcs/inmanilem.uc	\
	src/npcs/jaana.uc	\
	src/npcs/laurianna.uc	\
	src/npcs/leigh.uc	\
	src/npcs/lordbritish.uc	\
	src/npcs/lordheather.uc	\
	src/npcs/mariah.uc	\
	src/npcs/menion.uc	\
	src/npcs/npcs.uc	\
	src/npcs/perrin.uc	\
	src/npcs/related_functions/laurianna_dialog.uc	\
	src/npcs/related_functions/zauriel_dialog.uc	\
	src/npcs/reyna.uc	\
	src/npcs/tory.uc	\
	src/npcs/tseramed.uc	\
	src/npcs/willy.uc	\
	src/npcs/wisps.uc	\
	src/npcs/zauriel.uc	\
	src/quests/codex.uc	\
	src/quests/codex/show_codex.uc	\
	src/quests/keyring.uc	\
	src/quests/keyring/constants.uc	\
	src/quests/keyring/cutscenes/cheaters_cataclysm.uc	\
	src/quests/keyring/cutscenes/mage_and_goons.uc	\
	src/quests/keyring/cutscenes/zauriel_make_potion.uc	\
	src/quests/keyring/cutscenes/zauriel_ritual.uc	\
	src/quests/keyring/eggs.uc	\
	src/quests/keyring/functions.uc	\
	src/quests/locklake/cleanup_eggs.uc	\
	src/spells/eighth_circle.uc	\
	src/spells/fifth_circle.uc	\
	src/spells/first_circle.uc	\
	src/spells/fourth_circle.uc	\
	src/spells/linear_spells.uc	\
	src/spells/main_spells.uc	\
	src/spells/npc_spells.uc	\
	src/spells/second_circle.uc	\
	src/spells/seventh_circle.uc	\
	src/spells/sixth_circle.uc	\
	src/spells/spell_ai.uc	\
	src/spells/spell_functions.uc	\
	src/spells/spellbook_override.uc	\
	src/spells/third_circle.uc	\
	src/usecode.uc

FACES_VGA_OBJECTS :=	\
	src/graphics/faces.in	\
	src/graphics/faces/Avatar_Faces.shp	\
	src/graphics/faces/Codex.shp	\
	src/graphics/faces/Enemy_Faces.shp	\
	src/graphics/faces/Lauriannas_Faces.shp	\
	src/graphics/faces/Shrine_Faces.shp	\
	src/graphics/faces/Zauriel_Face.shp

GUMPS_VGA_OBJECTS :=	\
	src/graphics/gumps.in	\
	src/graphics/gumps/Black_Female_Gump.shp	\
	src/graphics/gumps/Black_Male_Gump.shp	\
	src/graphics/gumps/Brunette_Female_Gump.shp	\
	src/graphics/gumps/Brunette_Male_Gump.shp	\
	src/graphics/gumps/Buckethead_Female_Gump.shp	\
	src/graphics/gumps/Buckethead_Male_Gump.shp	\
	src/graphics/gumps/Laurianna_Gump.shp	\
	src/graphics/gumps/Mariah_Gump.shp	\
	src/graphics/gumps/Portable_Hole.shp	\
	src/graphics/gumps/Raven_Female_Gump.shp	\
	src/graphics/gumps/Raven_Male_Gump.shp	\
	src/graphics/gumps/Redhead_Female_Gump.shp	\
	src/graphics/gumps/Redhead_Male_Gump.shp

MAINSHP_FLX_OBJECTS :=	\
	src/graphics/mainshp.in	\
	src/graphics/mainshp/title.shp

PAPERDOL_VGA_OBJECTS :=	\
	src/graphics/paperdol.in	\
	src/graphics/paperdol/Female_Paperdoll.shp	\
	src/graphics/paperdol/FlyingCarpet.shp	\
	src/graphics/paperdol/LB_Crown_Paperdoll.shp	\
	src/graphics/paperdol/LB_Sceptre_Paperdoll.shp	\
	src/graphics/paperdol/Laurianna_Paperdoll.shp	\
	src/graphics/paperdol/Male_Paperdoll.shp	\
	src/graphics/paperdol/Mariah_Paperdoll.shp	\
	src/graphics/paperdol/Spell_Amulet_Paperdoll.shp	\
	src/graphics/paperdol/Spellbook_Paperdoll.shp

SHAPES_VGA_OBJECTS :=	\
	src/graphics/shapes.in	\
	src/graphics/shapes/Avatar_Bodies.shp	\
	src/graphics/shapes/Barrier.shp	\
	src/graphics/shapes/Black_Female_Avatar.shp	\
	src/graphics/shapes/Black_Female_Nude.shp	\
	src/graphics/shapes/Black_Male_Avatar.shp	\
	src/graphics/shapes/Black_Male_Nude.shp	\
	src/graphics/shapes/Blonde_Female_Avatar.shp	\
	src/graphics/shapes/Blonde_Female_Nude.shp	\
	src/graphics/shapes/Blonde_Male_Avatar.shp	\
	src/graphics/shapes/Blonde_Male_Nude.shp	\
	src/graphics/shapes/Bodies.shp	\
	src/graphics/shapes/Book.shp	\
	src/graphics/shapes/Brunette_Female_Avatar.shp	\
	src/graphics/shapes/Brunette_Female_Nude.shp	\
	src/graphics/shapes/Brunette_Male_Avatar.shp	\
	src/graphics/shapes/Brunette_Male_Nude.shp	\
	src/graphics/shapes/Bucket.shp	\
	src/graphics/shapes/Buckethead_Female_Avatar.shp	\
	src/graphics/shapes/Buckethead_Male_Avatar.shp	\
	src/graphics/shapes/Codex_Barrier.shp	\
	src/graphics/shapes/Codex_Carpet.shp	\
	src/graphics/shapes/Death_Bolt.shp	\
	src/graphics/shapes/Dough.shp	\
	src/graphics/shapes/Dupre.shp	\
	src/graphics/shapes/Fake_Water.shp	\
	src/graphics/shapes/Flame_of_Infinity.shp	\
	src/graphics/shapes/Flame_of_Principle.shp	\
	src/graphics/shapes/Flame_of_Singularity.shp	\
	src/graphics/shapes/FlyingCarpet-rolled.shp	\
	src/graphics/shapes/FlyingCarpet-roller.shp	\
	src/graphics/shapes/FlyingCarpet-unrolled.shp	\
	src/graphics/shapes/Iolo.shp	\
	src/graphics/shapes/Iolos_Lute.shp	\
	src/graphics/shapes/Item_of_Principle.shp	\
	src/graphics/shapes/Jaana.shp	\
	src/graphics/shapes/Julia.shp	\
	src/graphics/shapes/Julias_Hammer.shp	\
	src/graphics/shapes/Keyring.shp	\
	src/graphics/shapes/Kitchen_Items.shp	\
	src/graphics/shapes/LB_Amulet.shp	\
	src/graphics/shapes/LB_Crown.shp	\
	src/graphics/shapes/LB_Sceptre.shp	\
	src/graphics/shapes/Laurianna.shp	\
	src/graphics/shapes/Laurianna.shp	\
	src/graphics/shapes/Lord_British.shp	\
	src/graphics/shapes/Magic_Gem.shp	\
	src/graphics/shapes/Mariah.shp	\
	src/graphics/shapes/Moongate_NE_SW.shp	\
	src/graphics/shapes/Moongate_NW_SE.shp	\
	src/graphics/shapes/Portable_Hole.shp	\
	src/graphics/shapes/Potion.shp	\
	src/graphics/shapes/Raven_Female_Avatar.shp	\
	src/graphics/shapes/Raven_Female_Nude.shp	\
	src/graphics/shapes/Raven_Male_Avatar.shp	\
	src/graphics/shapes/Raven_Male_Nude.shp	\
	src/graphics/shapes/Redhead_Female_Avatar.shp	\
	src/graphics/shapes/Redhead_Female_Nude.shp	\
	src/graphics/shapes/Redhead_Male_Avatar.shp	\
	src/graphics/shapes/Redhead_Male_Nude.shp	\
	src/graphics/shapes/Rooted_Laurianna.shp	\
	src/graphics/shapes/Shamino.shp	\
	src/graphics/shapes/Shrines.shp	\
	src/graphics/shapes/Slate_Roof_2.shp	\
	src/graphics/shapes/Spell_Amulet.shp	\
	src/graphics/shapes/Spellbook.shp	\
	src/graphics/shapes/Spider_Egg.shp	\
	src/graphics/shapes/Stained_Glass_Horizontal.shp	\
	src/graphics/shapes/Stained_Glass_Vertical.shp	\
	src/graphics/shapes/Stairs_Down.shp	\
	src/graphics/shapes/Sword_Blank.shp

CLEANFILES :=	\
	data/usecode	\
	data/faces.vga	\
	data/faces_vga.h	\
	data/gumps.vga	\
	data/gumps_vga.h	\
	data/mainshp.flx	\
	data/mainshp_flx.h	\
	data/paperdol.vga	\
	data/paperdol_vga.h	\
	data/shapes.vga	\
	data/shapes_vga.h

all: data/usecode data/faces.vga data/gumps.vga data/mainshp.flx data/paperdol.vga data/shapes.vga

install: all
	mkdir -p $(bgkeyringdir)
	cp Keyring.cfg $(bgkeyringdir)/Keyring.cfg
	mkdir -p $(bgkeyringdir)/Keyring/data
	cp data/usecode $(bgkeyringdir)/Keyring/data/usecode
	cp data/faces.vga $(bgkeyringdir)/Keyring/data/faces.vga
	cp data/gumps.vga $(bgkeyringdir)/Keyring/data/gumps.vga
	cp data/mainshp.flx $(bgkeyringdir)/Keyring/data/mainshp.flx
	cp data/paperdol.vga $(bgkeyringdir)/Keyring/data/paperdol.vga
	cp data/shapes.vga $(bgkeyringdir)/Keyring/data/shapes.vga
	cp data/armor.dat $(bgkeyringdir)/Keyring/data/armor.dat
	cp data/avatar_data.txt $(bgkeyringdir)/Keyring/data/avatar_data.txt
	cp data/bodies.txt $(bgkeyringdir)/Keyring/data/bodies.txt
	cp data/combos.flx $(bgkeyringdir)/Keyring/data/combos.flx
	cp data/container.dat $(bgkeyringdir)/Keyring/data/container.dat
	cp data/equip.dat $(bgkeyringdir)/Keyring/data/equip.dat
	cp data/initgame.dat $(bgkeyringdir)/Keyring/data/initgame.dat
	cp data/minimaps.vga $(bgkeyringdir)/Keyring/data/minimaps.vga
	cp data/monsters.dat $(bgkeyringdir)/Keyring/data/monsters.dat
	cp data/occlude.dat $(bgkeyringdir)/Keyring/data/occlude.dat
	cp data/paperdol_info.txt $(bgkeyringdir)/Keyring/data/paperdol_info.txt
	cp data/patchkeys.txt $(bgkeyringdir)/Keyring/data/patchkeys.txt
	cp data/ready.dat $(bgkeyringdir)/Keyring/data/ready.dat
	cp data/shape_info.txt $(bgkeyringdir)/Keyring/data/shape_info.txt
	cp data/shpdims.dat $(bgkeyringdir)/Keyring/data/shpdims.dat
	cp data/textmsg.txt $(bgkeyringdir)/Keyring/data/textmsg.txt
	cp data/tfa.dat $(bgkeyringdir)/Keyring/data/tfa.dat
	cp data/u7ifix02 $(bgkeyringdir)/Keyring/data/u7ifix02
	cp data/u7ifix0d $(bgkeyringdir)/Keyring/data/u7ifix0d
	cp data/u7ifix2d $(bgkeyringdir)/Keyring/data/u7ifix2d
	cp data/u7ifix32 $(bgkeyringdir)/Keyring/data/u7ifix32
	cp data/u7ifix3a $(bgkeyringdir)/Keyring/data/u7ifix3a
	cp data/u7ifix41 $(bgkeyringdir)/Keyring/data/u7ifix41
	cp data/u7ifix52 $(bgkeyringdir)/Keyring/data/u7ifix52
	cp data/u7ifix6f $(bgkeyringdir)/Keyring/data/u7ifix6f
	cp data/u7ifix77 $(bgkeyringdir)/Keyring/data/u7ifix77
	cp data/u7ifix79 $(bgkeyringdir)/Keyring/data/u7ifix79
	cp data/u7ifix7b $(bgkeyringdir)/Keyring/data/u7ifix7b
	cp data/u7ifix7d $(bgkeyringdir)/Keyring/data/u7ifix7d
	cp data/u7ifix82 $(bgkeyringdir)/Keyring/data/u7ifix82
	cp data/u7ifix8e $(bgkeyringdir)/Keyring/data/u7ifix8e
	cp data/u7map $(bgkeyringdir)/Keyring/data/u7map
	cp data/weapons.dat $(bgkeyringdir)/Keyring/data/weapons.dat
	cp data/wgtvol.dat $(bgkeyringdir)/Keyring/data/wgtvol.dat
	cp data/wihh.dat $(bgkeyringdir)/Keyring/data/wihh.dat
	mkdir -p $(bgkeyringdir)/Keyring/data/map01
	cp data/map01/u7ifix77 $(bgkeyringdir)/Keyring/data/map01/u7ifix77
	cp data/map01/u7ifix7d $(bgkeyringdir)/Keyring/data/map01/u7ifix7d
	cp data/map01/u7map $(bgkeyringdir)/Keyring/data/map01/u7map
	cp Keyring.ico $(bgkeyringdir)/Keyring/Keyring.ico
	cp Keyring.png $(bgkeyringdir)/Keyring/Keyring.png
	cp Readme.txt $(bgkeyringdir)/Keyring/Readme.txt
	cp ./../../COPYING $(bgkeyringdir)/Keyring/License.txt

uninstall:
	rm -f $(bgkeyringdir)/Keyring.cfg
	rm -rf $(bgkeyringdir)/Keyring

$(EXPACK):
	+(cd $(EXPACKDIR);$(MAKE) -f Makefile.mingw expack.exe)

$(UCC):
	+(cd $(UCCDIR);$(MAKE) -f Makefile.mingw ucc.exe)


data/usecode: $(UCC) $(USECODE_OBJECTS)
	$(UCC) -I src -o data/usecode src/usecode.uc

data/faces.vga: $(EXPACK) $(FACES_VGA_OBJECTS)
	$(EXPACK) -i $(srcdir)/src/graphics/faces.in

data/gumps.vga: $(EXPACK) $(GUMPS_VGA_OBJECTS)
	$(EXPACK) -i $(srcdir)/src/graphics/gumps.in

data/mainshp.flx: $(EXPACK) $(MAINSHP_FLX_OBJECTS)
	$(EXPACK) -i $(srcdir)/src/graphics/mainshp.in

data/paperdol.vga: $(EXPACK) $(PAPERDOL_VGA_OBJECTS)
	$(EXPACK) -i $(srcdir)/src/graphics/paperdol.in

data/shapes.vga: $(EXPACK) $(SHAPES_VGA_OBJECTS)
	$(EXPACK) -i $(srcdir)/src/graphics/shapes.in

clean:
	rm -f $(CLEANFILES)

