#include "config.h"
#include "dirs.h"

NAME 		= ascd
BINDIR		= CBINDIR
MANDIR		= CMANDIR
THEMESDIR	= CTHDIR
MOREFLAGS	= -I/usr/local/include -I.
CCOPTIONS	= $(MOREFLAGS)
SYS_LIBRARIES	= $(XLIB) -lXpm

#ifdef WMK
WM_LIB = -lm -lz -lpng -lgif -ljpeg -ltiff -lPropList -lwraster -lWINGs
#else
WM_LIB = 
#endif

LOCAL_LIBRARIES = -L../libworkman -lworkman -L/usr/local/lib

SRCS = cdcontrol.c ascd.c
OBJS = cdcontrol.o ascd.o

AllTarget($(NAME))
NormalProgramTarget($(NAME),$(OBJS),NullParameter,$(SYS_LIBRARIES) $(LOCAL_LIBRARIES) $(WM_LIB),NullParameter)
InstallProgram($(NAME),$(BINDIR))
InstallManPage($(NAME),$(MANDIR))
InstallMultiple(themes/.dir,$(THEMESDIR))

install::
	@echo "Installing themes..."
	@cp themes/default.tar $(THEMESDIR)
	@cp themes/sands.tar $(THEMESDIR)
	@cp themes/clean.tar $(THEMESDIR)
	@cp themes/vintage.tar $(THEMESDIR)
	@cp themes/night.tar $(THEMESDIR)
	@cd $(THEMESDIR) ; tar xf default.tar
	@cd $(THEMESDIR) ; tar xf sands.tar
	@cd $(THEMESDIR) ; tar xf clean.tar
	@cd $(THEMESDIR) ; tar xf vintage.tar
	@cd $(THEMESDIR) ; tar xf night.tar
	@cd $(THEMESDIR) ; rm default.tar
	@cd $(THEMESDIR) ; rm sands.tar
	@cd $(THEMESDIR) ; rm clean.tar
	@cd $(THEMESDIR) ; rm vintage.tar
	@cd $(THEMESDIR) ; rm night.tar
	@cd $(THEMESDIR) ; rm .dir
	@cd $(THEMESDIR) ; /bin/ls -1 > /tmp/.dir
	@cd $(THEMESDIR) ; cp /tmp/.dir .
	@echo "Done."
