# Generated automatically by the configure script

ifneq ($(strip $(prefix)),)
  MPREFIX=$(prefix)
else
  MPREFIX=g:/dj
endif
ifeq ($(INSTALL),)
  INSTALL=install
endif
libdir=$(MPREFIX)/lib
CFLAGS=-O2 -Wall -Werror -gstabs+3
CXXFLAGS=-O2 -Wall -Werror -gstabs+3 -fno-exceptions -fno-rtti
MAINTAINER_MODE=1
export

.PHONY: needed infview plasmas libz libmpegsnd libpcre libintl installer internac doc-basic

all: Makefile editor libset infview plasmas installer


Makefile: config.pl conflib.pl
	$(error Please reconfigure the package! Alternative: "touch Makefile")

libmpegsnd:
	$(MAKE) -C mp3/mpegsound -f mpegsnd.mkf

libz:
	$(MAKE) -C libz libz.a

libpcre:
	$(MAKE) -C libpcre libpcre.a

libintl:
	$(MAKE) -C gettext

internac:
	$(MAKE) -C internac

doc-basic:
	$(MAKE) -C doc txt info

# Libraries not created by RHIDE projects
needed: libmpegsnd libz libpcre libintl include/vername.h internac doc-basic

editor: needed
	$(MAKE) -C makes

libset:
	$(MAKE) -C makes libset

infview:
	$(MAKE) -C makes infview

plasmas:
	cd scrnsave; $(MAKE); cd ..

installer: editor
	$(MAKE) -C makes installer

include/vername.h: change.log
	perl updaterev.pl

install-editor: editor
	$(MAKE) -C makes install

install-libset: libset
	$(INSTALL) -d -m 0755 $(libdir)
	$(INSTALL) -m 0644 makes/libset.a $(libdir)


install-infview: infview
	$(MAKE) -C makes install-infview

install: install-editor install-libset install-infview


distrib-editor: needed
	$(MAKE) -C makes distrib 

distrib-source:
	$(MAKE) -C makes distrib-source 

distrib-infview: needed
	$(MAKE) -C makes distrib-infview 

distrib: distrib-editor distrib-infview

clean:
	cd makes; $(MAKE) clean-o; $(MAKE) clean-docs; cd ..
	rm -f configure.cache
	rm -f Makefile
	rm -f errormsg.txt
	rm -f doc/sdh.exe
	rm -f include/configed.h
	rm -rf makes/djgpp/distinf makes/djgpp/distrib makes/djgpp/result makes/djgpp/resulinf
	rm -f makes/*.a makes/*.exe makes/*.gdt
	rm -f mp3/libamp/*.a mp3/libamp/obj/*.o
	rm -f mp3/mpegsound/*.a mp3/mpegsound/obj/*.o
	cd scrnsave; $(MAKE) clean-o; cd ..
	$(MAKE) -C libz clean
	$(MAKE) -C libpcre clean
