# Project: examples

CPP  = g++.exe
CC   = gcc.exe
RM   = rm

INCS     =  -I"../"
CXXFLAGS = $(INCS) -fpermissive -O2 -fno-exceptions -Wno-error -w
LIBS     = -lac
LFLAGS   = -L./Release -s -Wl

Release: all

all: prepare cmdclient shownp shownp_dyn getplaylist getsonginfo

shownp: shownp.o
	$(CPP) $(CXXFLAGS) $(LFLAGS) $^ $(LIBS) -o ./Release/$@.exe

cmdclient: cmdclient.o
	$(CPP) $(CXXFLAGS) $(LFLAGS) $^ $(LIBS) -o ./Release/$@.exe

shownp_dyn: shownp_dyn.o
	$(CPP) $(CXXFLAGS) $(LFLAGS) $^ -o ./Release/$@.exe

getplaylist: getplaylist.o
	$(CPP) $(CXXFLAGS) $(LFLAGS) $^ $(LIBS) -o ./Release/$@.exe

getsonginfo: getsonginfo.o xgetopt.o
	$(CPP) $(CXXFLAGS) $(LFLAGS) $^ $(LIBS) -o ./Release/$@.exe

clean:
	$(RM) -f *.o *.exe ./Release/*.*
	rmdir Release

prepare:
	mkdir -p Release
	cp ../Release/ac.lib ac.lib
	cp ../Release/ac.dll ./Release/ac.dll
	tools/reimp.exe ac.lib
	rm -f ac.lib ac.def
	mv libac.a ./Release/libac.a
