#
# Install, and make if needed, prboom.wad
#

noinst_PROGRAMS = rdatawad
rdatawad_SOURCES = rd_main.c
rdatawad_SOURCES += rd_util.c rd_util.h
rdatawad_SOURCES += rd_output.c rd_output.h
rdatawad_SOURCES += rd_sound.c rd_sound.h
rdatawad_SOURCES += rd_palette.c rd_palette.h
rdatawad_SOURCES += rd_graphic.c rd_graphic.h

waddir=$(DOOMWADDIR)
wad_DATA=prboom-plus.wad

PALETTE = palette.rgb

LUMPS = lumps/switches.lmp
LUMPS += lumps/animated.lmp
LUMPS += lumps/crbrick.lmp
LUMPS += lumps/crtan.lmp
LUMPS += lumps/crgray.lmp
LUMPS += lumps/crgreen.lmp
LUMPS += lumps/crbrown.lmp
LUMPS += lumps/crgold.lmp
LUMPS += lumps/crred.lmp
LUMPS += lumps/crblue.lmp
LUMPS += lumps/crblue2.lmp
LUMPS += lumps/crorange.lmp
LUMPS += lumps/cryellow.lmp

COLORMAPS = lumps/watermap.lmp

TABLES = lumps/sinetabl.lmp
TABLES += lumps/tangtabl.lmp
TABLES += lumps/tantoang.lmp
TABLES += lumps/gammatbl.lmp

TABLES += lumps/chexdeh.lmp
TABLES += lumps/bfgbex.lmp
TABLES += lumps/nervebex.lmp
TABLES += lumps/glshadow.lmp
TABLES += lumps/glfp.lmp
TABLES += lumps/glvp.lmp
TABLES += lumps/-prbhud-.lmp
TABLES += lumps/m_ammo.lmp
TABLES += lumps/m_armour.lmp
TABLES += lumps/m_arrow.lmp
TABLES += lumps/m_health.lmp
TABLES += lumps/m_key.lmp
TABLES += lumps/m_normal.lmp
TABLES += lumps/m_shadow.lmp
TABLES += lumps/m_power.lmp
TABLES += lumps/m_weap.lmp
TABLES += lumps/m_mark.lmp

SOUNDS =
if DOGS
if NONFREE_GRAPHICS
SOUNDS += sounds/dsdgsit.wav
SOUNDS += sounds/dsdgatk.wav
SOUNDS += sounds/dsdgact.wav
SOUNDS += sounds/dsdgdth.wav
SOUNDS += sounds/dsdgpain.wav
else
SOUNDS += sounds/free/dsdgsit.wav
SOUNDS += sounds/free/dsdgatk.wav
SOUNDS += sounds/free/dsdgact.wav
SOUNDS += sounds/free/dsdgdth.wav
SOUNDS += sounds/free/dsdgpain.wav
endif
endif

if NONFREE_GRAPHICS
SOUNDS += sounds/dssecret.wav
SOUNDS += sounds/dsgibdth.wav
endif

GRAPHICS = graphics/dig0.ppm
GRAPHICS += graphics/dig1.ppm
GRAPHICS += graphics/dig2.ppm
GRAPHICS += graphics/dig3.ppm
GRAPHICS += graphics/dig4.ppm
GRAPHICS += graphics/dig5.ppm
GRAPHICS += graphics/dig6.ppm
GRAPHICS += graphics/dig7.ppm
GRAPHICS += graphics/dig8.ppm
GRAPHICS += graphics/dig9.ppm
GRAPHICS += graphics/diga.ppm
GRAPHICS += graphics/digb.ppm
GRAPHICS += graphics/digc.ppm
GRAPHICS += graphics/digd.ppm
GRAPHICS += graphics/dige.ppm
GRAPHICS += graphics/digf.ppm
GRAPHICS += graphics/digg.ppm
GRAPHICS += graphics/digh.ppm
GRAPHICS += graphics/digi.ppm
GRAPHICS += graphics/digj.ppm
GRAPHICS += graphics/digk.ppm
GRAPHICS += graphics/digl.ppm
GRAPHICS += graphics/digm.ppm
GRAPHICS += graphics/dign.ppm
GRAPHICS += graphics/digo.ppm
GRAPHICS += graphics/digp.ppm
GRAPHICS += graphics/digq.ppm
GRAPHICS += graphics/digr.ppm
GRAPHICS += graphics/digs.ppm
GRAPHICS += graphics/digt.ppm
GRAPHICS += graphics/digu.ppm
GRAPHICS += graphics/digv.ppm
GRAPHICS += graphics/digw.ppm
GRAPHICS += graphics/digx.ppm
GRAPHICS += graphics/digy.ppm
GRAPHICS += graphics/digz.ppm
GRAPHICS += graphics/dig45.ppm
GRAPHICS += graphics/dig47.ppm
GRAPHICS += graphics/dig58.ppm
GRAPHICS += graphics/dig91.ppm
GRAPHICS += graphics/dig93.ppm
GRAPHICS += graphics/stbr123.ppm
GRAPHICS += graphics/stbr124.ppm
GRAPHICS += graphics/stbr125.ppm
GRAPHICS += graphics/stbr126.ppm
GRAPHICS += graphics/stbr127.ppm
GRAPHICS += graphics/boxul.ppm
GRAPHICS += graphics/boxuc.ppm
GRAPHICS += graphics/boxur.ppm
GRAPHICS += graphics/boxcl.ppm
GRAPHICS += graphics/boxcc.ppm
GRAPHICS += graphics/boxcr.ppm
GRAPHICS += graphics/boxll.ppm
GRAPHICS += graphics/boxlc.ppm
GRAPHICS += graphics/boxlr.ppm
GRAPHICS += graphics/stkeys6.ppm
GRAPHICS += graphics/stkeys7.ppm
GRAPHICS += graphics/stkeys8.ppm
GRAPHICS += graphics/stcfn096.ppm
GRAPHICS += graphics/m_butt1.ppm
GRAPHICS += graphics/m_butt2.ppm
GRAPHICS += graphics/m_colors.ppm
GRAPHICS += graphics/m_palno.ppm
GRAPHICS += graphics/m_palsel.ppm
GRAPHICS += graphics/m_vbox.ppm
GRAPHICS += graphics/cross1.ppm
GRAPHICS += graphics/cross2.ppm
GRAPHICS += graphics/cross3.ppm

if NONFREE_GRAPHICS
GRAPHICS += graphics/m_generl.ppm
GRAPHICS += graphics/m_setup.ppm
GRAPHICS += graphics/m_auto.ppm
GRAPHICS += graphics/m_keybnd.ppm
GRAPHICS += graphics/m_chat.ppm
GRAPHICS += graphics/m_compat.ppm
GRAPHICS += graphics/m_enem.ppm
GRAPHICS += graphics/m_mess.ppm
GRAPHICS += graphics/m_stat.ppm
GRAPHICS += graphics/m_weap.ppm
GRAPHICS += graphics/m_horsen.ppm
GRAPHICS += graphics/m_versen.ppm
GRAPHICS += graphics/prboom.ppm
GRAPHICS += graphics/m_accel.ppm
GRAPHICS += graphics/m_loksen.ppm
endif

FLATS = flats/-n0_tex-.ppm

SPRITES = sprites/tnt1a0.ppm
SPRITEP = 0,0,sprites/tnt1a0.ppm

if DOGS
if NONFREE_GRAPHICS
SPRITES += sprites/dogsd5.ppm
SPRITEP += 32,59,sprites/dogsd5.ppm
SPRITES += sprites/dogsh5.ppm
SPRITEP += 32,59,sprites/dogsh5.ppm
SPRITES += sprites/dogsc5.ppm
SPRITEP += 32,59,sprites/dogsc5.ppm
SPRITES += sprites/dogsg5.ppm
SPRITEP += 32,59,sprites/dogsg5.ppm
SPRITES += sprites/dogsb1.ppm
SPRITEP += 32,59,sprites/dogsb1.ppm
SPRITES += sprites/dogsa5.ppm
SPRITEP += 32,59,sprites/dogsa5.ppm
SPRITES += sprites/dogse5.ppm
SPRITEP += 32,59,sprites/dogse5.ppm
SPRITES += sprites/dogsc1.ppm
SPRITEP += 32,59,sprites/dogsc1.ppm
SPRITES += sprites/dogsd1.ppm
SPRITEP += 32,59,sprites/dogsd1.ppm
SPRITES += sprites/dogsb5.ppm
SPRITEP += 32,59,sprites/dogsb5.ppm
SPRITES += sprites/dogsf5.ppm
SPRITEP += 32,59,sprites/dogsf5.ppm
SPRITES += sprites/dogsa1.ppm
SPRITEP += 32,59,sprites/dogsa1.ppm
SPRITES += sprites/dogse1.ppm
SPRITEP += 32,59,sprites/dogse1.ppm
SPRITES += sprites/dogsf1.ppm
SPRITEP += 32,59,sprites/dogsf1.ppm
SPRITES += sprites/dogsd2d8.ppm
SPRITEP += 32,59,sprites/dogsd2d8.ppm
SPRITES += sprites/dogsh2.ppm
SPRITEP += 32,59,sprites/dogsh2.ppm
SPRITES += sprites/dogsg1.ppm
SPRITEP += 32,59,sprites/dogsg1.ppm
SPRITES += sprites/dogsh8.ppm
SPRITEP += 32,59,sprites/dogsh8.ppm
SPRITES += sprites/dogse8.ppm
SPRITEP += 32,59,sprites/dogse8.ppm
SPRITES += sprites/dogsd4d6.ppm
SPRITEP += 32,59,sprites/dogsd4d6.ppm
SPRITES += sprites/dogsh4.ppm
SPRITEP += 32,59,sprites/dogsh4.ppm
SPRITES += sprites/dogsa2a8.ppm
SPRITEP += 32,59,sprites/dogsa2a8.ppm
SPRITES += sprites/dogse2.ppm
SPRITEP += 32,59,sprites/dogse2.ppm
SPRITES += sprites/dogsf8.ppm
SPRITEP += 32,59,sprites/dogsf8.ppm
SPRITES += sprites/dogsh1.ppm
SPRITEP += 32,59,sprites/dogsh1.ppm
SPRITES += sprites/dogsa4a6.ppm
SPRITEP += 32,59,sprites/dogsa4a6.ppm
SPRITES += sprites/dogse4.ppm
SPRITEP += 32,59,sprites/dogse4.ppm
SPRITES += sprites/dogsb4b6.ppm
SPRITEP += 32,59,sprites/dogsb4b6.ppm
SPRITES += sprites/dogsf4.ppm
SPRITEP += 32,59,sprites/dogsf4.ppm
SPRITES += sprites/dogsh6.ppm
SPRITEP += 32,59,sprites/dogsh6.ppm
SPRITES += sprites/dogsb2b8.ppm
SPRITEP += 32,59,sprites/dogsb2b8.ppm
SPRITES += sprites/dogsf2.ppm
SPRITEP += 32,59,sprites/dogsf2.ppm
SPRITES += sprites/dogsc2c8.ppm
SPRITEP += 32,59,sprites/dogsc2c8.ppm
SPRITES += sprites/dogsg2.ppm
SPRITEP += 32,59,sprites/dogsg2.ppm
SPRITES += sprites/dogsg6.ppm
SPRITEP += 32,59,sprites/dogsg6.ppm
SPRITES += sprites/dogsc4c6.ppm
SPRITEP += 32,59,sprites/dogsc4c6.ppm
SPRITES += sprites/dogsg4.ppm
SPRITEP += 32,59,sprites/dogsg4.ppm
SPRITES += sprites/dogsg8.ppm
SPRITEP += 32,59,sprites/dogsg8.ppm
SPRITES += sprites/dogsf6.ppm
SPRITEP += 32,59,sprites/dogsf6.ppm
SPRITES += sprites/dogsn0.ppm
SPRITEP += 32,59,sprites/dogsn0.ppm
SPRITES += sprites/dogse6.ppm
SPRITEP += 32,59,sprites/dogse6.ppm
SPRITES += sprites/dogsd3d7.ppm
SPRITEP += 32,59,sprites/dogsd3d7.ppm
SPRITES += sprites/dogsh3.ppm
SPRITEP += 32,59,sprites/dogsh3.ppm
SPRITES += sprites/dogsh7.ppm
SPRITEP += 32,59,sprites/dogsh7.ppm
SPRITES += sprites/dogsi0.ppm
SPRITEP += 32,59,sprites/dogsi0.ppm
SPRITES += sprites/dogsa3a7.ppm
SPRITEP += 32,59,sprites/dogsa3a7.ppm
SPRITES += sprites/dogse3.ppm
SPRITEP += 32,59,sprites/dogse3.ppm
SPRITES += sprites/dogsb3b7.ppm
SPRITEP += 32,59,sprites/dogsb3b7.ppm
SPRITES += sprites/dogsf3.ppm
SPRITEP += 32,59,sprites/dogsf3.ppm
SPRITES += sprites/dogsf7.ppm
SPRITEP += 32,59,sprites/dogsf7.ppm
SPRITES += sprites/dogse7.ppm
SPRITEP += 32,59,sprites/dogse7.ppm
SPRITES += sprites/dogsc3c7.ppm
SPRITEP += 32,59,sprites/dogsc3c7.ppm
SPRITES += sprites/dogsg3.ppm
SPRITEP += 32,59,sprites/dogsg3.ppm
SPRITES += sprites/dogsg7.ppm
SPRITEP += 32,59,sprites/dogsg7.ppm
SPRITES += sprites/dogsj0.ppm
SPRITEP += 32,59,sprites/dogsj0.ppm
SPRITES += sprites/dogsk0.ppm
SPRITEP += 32,59,sprites/dogsk0.ppm
SPRITES += sprites/dogsl0.ppm
SPRITEP += 32,59,sprites/dogsl0.ppm
SPRITES += sprites/dogsm0.ppm
SPRITEP += 32,59,sprites/dogsm0.ppm
else
SPRITES += sprites/free/dogsa1.ppm
SPRITEP += 10,30,sprites/free/dogsa1.ppm
SPRITES += sprites/free/dogsa2a8.ppm
SPRITEP += 14,29,sprites/free/dogsa2a8.ppm
SPRITES += sprites/free/dogsa3a7.ppm
SPRITEP += 15,29,sprites/free/dogsa3a7.ppm
SPRITES += sprites/free/dogsa4a6.ppm
SPRITEP += 12,29,sprites/free/dogsa4a6.ppm
SPRITES += sprites/free/dogsa5.ppm
SPRITEP += 10,30,sprites/free/dogsa5.ppm
SPRITES += sprites/free/dogsb1.ppm
SPRITEP += 9,30,sprites/free/dogsb1.ppm
SPRITES += sprites/free/dogsb2b8.ppm
SPRITEP += 13,29,sprites/free/dogsb2b8.ppm
SPRITES += sprites/free/dogsb3b7.ppm
SPRITEP += 14,29,sprites/free/dogsb3b7.ppm
SPRITES += sprites/free/dogsb4b6.ppm
SPRITEP += 12,29,sprites/free/dogsb4b6.ppm
SPRITES += sprites/free/dogsb5.ppm
SPRITEP += 9,29,sprites/free/dogsb5.ppm
SPRITES += sprites/free/dogsc1.ppm
SPRITEP += 10,30,sprites/free/dogsc1.ppm
SPRITES += sprites/free/dogsc2c8.ppm
SPRITEP += 11,29,sprites/free/dogsc2c8.ppm
SPRITES += sprites/free/dogsc3c7.ppm
SPRITEP += 14,29,sprites/free/dogsc3c7.ppm
SPRITES += sprites/free/dogsc4c6.ppm
SPRITEP += 12,29,sprites/free/dogsc4c6.ppm
SPRITES += sprites/free/dogsc5.ppm
SPRITEP += 10,30,sprites/free/dogsc5.ppm
SPRITES += sprites/free/dogsd1.ppm
SPRITEP += 10,30,sprites/free/dogsd1.ppm
SPRITES += sprites/free/dogsd2d8.ppm
SPRITEP += 12,29,sprites/free/dogsd2d8.ppm
SPRITES += sprites/free/dogsd3d7.ppm
SPRITEP += 14,29,sprites/free/dogsd3d7.ppm
SPRITES += sprites/free/dogsd4d6.ppm
SPRITEP += 13,29,sprites/free/dogsd4d6.ppm
SPRITES += sprites/free/dogsd5.ppm
SPRITEP += 9,29,sprites/free/dogsd5.ppm
SPRITES += sprites/free/dogse1.ppm
SPRITEP += 10,30,sprites/free/dogse1.ppm
SPRITES += sprites/free/dogse2.ppm
SPRITEP += 14,29,sprites/free/dogse2.ppm
SPRITES += sprites/free/dogse3.ppm
SPRITEP += 14,29,sprites/free/dogse3.ppm
SPRITES += sprites/free/dogse4.ppm
SPRITEP += 13,29,sprites/free/dogse4.ppm
SPRITES += sprites/free/dogse5.ppm
SPRITEP += 9,29,sprites/free/dogse5.ppm
SPRITES += sprites/free/dogse6.ppm
SPRITEP += 13,29,sprites/free/dogse6.ppm
SPRITES += sprites/free/dogse7.ppm
SPRITEP += 14,29,sprites/free/dogse7.ppm
SPRITES += sprites/free/dogse8.ppm
SPRITEP += 14,29,sprites/free/dogse8.ppm
SPRITES += sprites/free/dogsf1.ppm
SPRITEP += 10,30,sprites/free/dogsf1.ppm
SPRITES += sprites/free/dogsf2.ppm
SPRITEP += 13,29,sprites/free/dogsf2.ppm
SPRITES += sprites/free/dogsf3.ppm
SPRITEP += 16,29,sprites/free/dogsf3.ppm
SPRITES += sprites/free/dogsf4.ppm
SPRITEP += 13,29,sprites/free/dogsf4.ppm
SPRITES += sprites/free/dogsf5.ppm
SPRITEP += 9,28,sprites/free/dogsf5.ppm
SPRITES += sprites/free/dogsf6.ppm
SPRITEP += 13,29,sprites/free/dogsf6.ppm
SPRITES += sprites/free/dogsf7.ppm
SPRITEP += 16,29,sprites/free/dogsf7.ppm
SPRITES += sprites/free/dogsf8.ppm
SPRITEP += 13,29,sprites/free/dogsf8.ppm
SPRITES += sprites/free/dogsg1.ppm
SPRITEP += 9,30,sprites/free/dogsg1.ppm
SPRITES += sprites/free/dogsg2.ppm
SPRITEP += 12,29,sprites/free/dogsg2.ppm
SPRITES += sprites/free/dogsg3.ppm
SPRITEP += 13,29,sprites/free/dogsg3.ppm
SPRITES += sprites/free/dogsg4.ppm
SPRITEP += 11,29,sprites/free/dogsg4.ppm
SPRITES += sprites/free/dogsg5.ppm
SPRITEP += 8,28,sprites/free/dogsg5.ppm
SPRITES += sprites/free/dogsg6.ppm
SPRITEP += 11,29,sprites/free/dogsg6.ppm
SPRITES += sprites/free/dogsg7.ppm
SPRITEP += 13,29,sprites/free/dogsg7.ppm
SPRITES += sprites/free/dogsg8.ppm
SPRITEP += 12,29,sprites/free/dogsg8.ppm
SPRITES += sprites/free/dogsh1.ppm
SPRITEP += 9,25,sprites/free/dogsh1.ppm
SPRITES += sprites/free/dogsh2.ppm
SPRITEP += 10,26,sprites/free/dogsh2.ppm
SPRITES += sprites/free/dogsh3.ppm
SPRITEP += 11,26,sprites/free/dogsh3.ppm
SPRITES += sprites/free/dogsh4.ppm
SPRITEP += 11,26,sprites/free/dogsh4.ppm
SPRITES += sprites/free/dogsh5.ppm
SPRITEP += 9,26,sprites/free/dogsh5.ppm
SPRITES += sprites/free/dogsh6.ppm
SPRITEP += 11,26,sprites/free/dogsh6.ppm
SPRITES += sprites/free/dogsh7.ppm
SPRITEP += 11,26,sprites/free/dogsh7.ppm
SPRITES += sprites/free/dogsh8.ppm
SPRITEP += 10,26,sprites/free/dogsh8.ppm
SPRITES += sprites/free/dogsi0.ppm
SPRITEP += 10,30,sprites/free/dogsi0.ppm
SPRITES += sprites/free/dogsj0.ppm
SPRITEP += 10,30,sprites/free/dogsj0.ppm
SPRITES += sprites/free/dogsk0.ppm
SPRITEP += 11,27,sprites/free/dogsk0.ppm
SPRITES += sprites/free/dogsl0.ppm
SPRITEP += 11,20,sprites/free/dogsl0.ppm
SPRITES += sprites/free/dogsm0.ppm
SPRITEP += 12,15,sprites/free/dogsm0.ppm
SPRITES += sprites/free/dogsn0.ppm
SPRITEP += 13,15,sprites/free/dogsn0.ppm
endif
endif

if NONFREE_GRAPHICS
SPRITES += sprites/pls1a0.ppm
SPRITEP += 8,12,sprites/pls1a0.ppm
SPRITES += sprites/pls1b0.ppm
SPRITEP += 9,12,sprites/pls1b0.ppm
SPRITES += sprites/pls1c0.ppm
SPRITEP += 8,12,sprites/pls1c0.ppm
SPRITES += sprites/pls1d0.ppm
SPRITEP += 9,12,sprites/pls1d0.ppm
SPRITES += sprites/pls1e0.ppm
SPRITEP += 25,37,sprites/pls1e0.ppm
SPRITES += sprites/pls1f0.ppm
SPRITEP += 25,37,sprites/pls1f0.ppm
SPRITES += sprites/pls1g0.ppm
SPRITEP += 26,42,sprites/pls1g0.ppm
SPRITES += sprites/pls2a0.ppm
SPRITEP += 7,10,sprites/pls2a0.ppm
SPRITES += sprites/pls2b0.ppm
SPRITEP += 6,8,sprites/pls2b0.ppm
SPRITES += sprites/pls2c0.ppm
SPRITEP += 5,6,sprites/pls2c0.ppm
SPRITES += sprites/pls2d0.ppm
SPRITEP += 7,10,sprites/pls2d0.ppm
SPRITES += sprites/pls2e0.ppm
SPRITEP += 11,16,sprites/pls2e0.ppm
endif

WAD_SRC = $(PALETTE) $(LUMPS) $(COLORMAPS) $(TABLES) \
          $(SOUNDS) $(GRAPHICS) $(FLATS) $(SPRITES)

WAD_CMDLINE = -palette $(PALETTE)
WAD_CMDLINE += -lumps $(LUMPS)
WAD_CMDLINE += -marker C_START -lumps $(COLORMAPS) -marker C_END
WAD_CMDLINE += -marker B_START -lumps $(TABLES) -marker B_END
WAD_CMDLINE += -sounds $(SOUNDS)
WAD_CMDLINE += -graphics $(GRAPHICS)
WAD_CMDLINE += -marker FF_START -flats $(FLATS) -marker FF_END
WAD_CMDLINE += -marker SS_START -sprites $(SPRITEP) -marker SS_END

prboom-plus.wad : rdatawad $(WAD_SRC)
	${AM_V_GEN}./rdatawad -I $(srcdir) $(WAD_CMDLINE) -o $@

EXTRA_DIST=$(WAD_SRC)
CLEANFILES=prboom-plus.wad
