# Makefile for VgaGames: bin/

PROGRAMS = vg4 vg4_nw_server
SRCS = vg4.c vg4-font.c vg4-text.c vg4-sprite.c vg4-canvas.c vg4-film.c

CFLAGS = -W -Wall -O2 -fsigned-char -g
PREFIX = `vgagames4-config --prefix`


all: $(PROGRAMS)

install:
	for pg in $(PROGRAMS); do \
	  test ! -f $$pg && true || { cp $$pg $(PREFIX)/bin/ && chmod 755 $(PREFIX)/bin/$$pg; } \
	done

clean:
	rm -f $(PROGRAMS)
	rm -f *.o

uninstall:
	cd $(PREFIX)/bin && rm -f $(PROGRAMS) || true


vg4: $(SRCS) vg4.h
	$(CC) $(CFLAGS) $(SRCS) `vgagames4-config --cflags --libs` -o vg4

vg4_nw_server: vg4_nw_server.c
	$(CC) $(CFLAGS) vg4_nw_server.c `vgagames4-config --cflags --libs` -o vg4_nw_server

