include ../Makefile.rules

OBJBASE = favorites.o main.o

ifeq "$(GTKVERSION)" "1"
GTK =  linux_gps.o gps.o routing.o gui_selectdir.o gui_selectfile.o gui_config.o gui_buttons.o gui_favorites.o gui_mainmenu.o gui_search.o guiw_gpsfile.o wnd_routing.o wnd_mapcontext.o
endif

ifeq "$(NCURSESVERSION)" "1"
CURSES = ncurses_main.o
endif

ifeq "$(WINVERSION)" "1"
WIN = gps.o routing.o gui_buttons.o gui_config.o gui_selectdir.o gui_selectfile.o gui_favorites.o gui_mainmenu.o gui_search.o guiw_gpsfile.o wnd_routing.o wnd_mapcontext.o
endif

ifeq "$(WINCEVERSION)" "1"
WIN =  gps.o routing.o gui_buttons.o gui_config.o gui_favorites.o gui_selectdir.o gui_selectfile.o gui_mainmenu.o gui_search.o guiw_gpsfile.o wnd_routing.o wnd_mapcontext.o
endif

ifeq "$(SDLGLVERSION)" "1"
SDLGL = linux_gps.o gps.o routing.o gui_config.o gui_buttons.o gui_favorites.o gui_selectdir.o gui_selectfile.o gui_mainmenu.o gui_search.o guiw_gpsfile.o wnd_routing.o wnd_mapcontext.o
endif


OBJ = $(OBJBASE) $(CURSES) $(GTK) $(WIN) $(SDLGL)
SRC = $(OBJ:%.o=%.c)

all: libmain.a

libmain.a: $(OBJ)
	$(AR) rcs libmain.a $(OBJ)

dep: $(SRC)
	$(CC) -MM $(SRC) $(CFLAGS) > $(DEPENDFILE)

clean:
	rm -rf *.o
	rm -rf *.a
	rm -rf *~
	rm -rf $(DEPENDFILE)

-include $(DEPENDFILE)

