
ifeq ($(MAKE),)
MAKE=make
endif


FLAGS=-I ../sources.cc/atoms/include/
LIBS= -lpng -lz -ljpeg -lm  -lpthread


#### OS autodetection part of makefile ####


#library components
LIBS+=../sources.cc/atoms/libatoms.a


.SUFFIXES: .c .cc $(OBJ) .exe

.c$(OBJ):
	gcc $(FLAGS) $(DEBUG) -c $*.c $(ERROR) -o $*$(OBJ) $(GETTEXT)

.cc$(OBJ):
	g++ $(FLAGS) $(DEBUG) -c $*.cc $(ERROR) -o $*$(OBJ) $(GETTEXT) 

$(OBJ).exe:
	g++ $*$(OBJ) $(LIBS) $(ERROR)


menucfg.exe: menucfg.cc ../sources.cc/atoms/libatoms.a
	g++ $(FLAGS) -o menucfg.exe menucfg.cc $(LIBS)

inst_gt.exe: inst_gt.cc ../sources.cc/atoms/libatoms.a
	g++ $(FLAGS) -o inst_gt.exe inst_gt.cc ../sources.cc/wp2lfuti.cc $(LIBS)


../sources.cc/atoms/libatoms.a:
	$(MAKE) -C ../sources.cc/atoms libatoms.a

clean:
	rm -f igt.bat *.exe *.com *.o *.obj *.bak *.bkp *.map *.rpo *.~?? core *.swp *.ilk *.tfa *.lk1 *.mk1 *.mk *.err *.pch *.ncb *.opt *.plg *.out *.cv4

distclean: clean
	rm makefile
	cp makefile.gen makefile

generic:
	rm makefile
	cp makefile.gen makefile
