# Makefile for VgaGames4

HFILES = vgagames4.h vgi.h extlib/extlib.h


all: vgi.o intern.o extlib.d hash.d input.d window.d audio.d \
	image.d font.d mlang.d random.d sprite.d nw.d misc.d \
	canvas.d dialog.d object.d collision.d film.d actionstack.d \
	nodelink.d

clean:
	cd nodelink && $(MAKE) clean
	cd actionstack && $(MAKE) clean
	cd film && $(MAKE) clean
	cd collision && $(MAKE) clean
	cd object && $(MAKE) clean
	cd dialog && $(MAKE) clean
	cd canvas && $(MAKE) clean
	cd misc && $(MAKE) clean
	cd nw && $(MAKE) clean
	cd sprite && $(MAKE) clean
	cd random && $(MAKE) clean
	cd mlang && $(MAKE) clean
	cd font && $(MAKE) clean
	cd image && $(MAKE) clean
	cd audio && $(MAKE) clean
	cd window && $(MAKE) clean
	cd input && $(MAKE) clean
	cd hash && $(MAKE) clean
	cd extlib && $(MAKE) clean
	rm -f *.o vgagames4.h opt_disable.h


vgi.o: vgi.c $(HFILES)
	$(CC) $(CFLAGS) $(SOFLAGS) -c vgi.c

intern.o: intern.c $(HFILES)
	$(CC) $(CFLAGS) $(SOFLAGS) -c intern.c

extlib.d:
	cd extlib && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" IOLIB_SCRIPT="$(IOLIB_SCRIPT)" all

hash.d:
	cd hash && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

input.d:
	cd input && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

window.d:
	cd window && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

audio.d:
	cd audio && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

image.d:
	cd image && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

font.d:
	cd font && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

mlang.d:
	cd mlang && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

random.d:
	cd random && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

sprite.d:
	cd sprite && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

nw.d:
	cd nw && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

misc.d:
	cd misc && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

canvas.d:
	cd canvas && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

dialog.d:
	cd dialog && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

object.d:
	cd object && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

collision.d:
	cd collision && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

film.d:
	cd film && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

actionstack.d:
	cd actionstack && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

nodelink.d:
	cd nodelink && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" SOFLAGS="$(SOFLAGS)" all

