# 
# Copyright (C) 1994 
#            Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de)
#
# This file is part of xplaycd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

SRCS	=	McApp.c McResource.c McGadget.c McText.c McBitmap.c McSlider.c\
		McMenu.c McOrder.c McDigits.c McString.c McSelector.c \
		McDebug.c McAlloc.c McUtils.c McFileRequest.c McViewText.c \
		McLoad.c McInfoRequest.c McChoice.c McMenubar.c McSelection.c \
		McBuffer.c McMeter.c McKnob.c McViewBitmap.c
OBJS	=	McApp.o McResource.o McGadget.o McText.o McBitmap.o McSlider.o\
		McMenu.o McOrder.o McDigits.o McString.o McSelector.o \
		McDebug.o McAlloc.o McUtils.o McFileRequest.o McViewText.o \
		McLoad.o McInfoRequest.o McChoice.o McMenubar.o McSelection.o \
		McBuffer.o McMeter.o McKnob.o McViewBitmap.o

ifeq ($(BUILD_SHARED),YES)

CFLAGS	=	-I. -I../bitmaps -fPIC $(COPTS)

all:: libMcTools.so

else

CFLAGS	=	-I. -I../bitmaps $(COPTS)

all:: libMcTools.a

endif


ifeq (.depend,$(wildcard .depend))
include .depend
else
DEPEND=needdepend
endif

libMcTools.a: $(DEPEND) $(OBJS)
ifdef RANLIB
	$(AR) libMcTools.a $(OBJS)
	$(RANLIB) libMcTools.a
else
	$(AR) libMcTools.a $(OBJS)
endif

# Linux ELF only!
libMcTools.so: $(DEPEND) $(OBJS)
	gcc -o libMcTools.so -shared -Wl,-soname,libMcTools.so $(OBJS)

clean:
	rm -f *.o

proper:
	rm -f *.o libMcTools.* .depend

needdepend: depend
	@echo
	@echo "Dependency information created, please re-run make and ignore"
	@echo "the error that follows."
	@echo
	@exit 1

depend:
	$(CPP) -MM $(CFLAGS) $(SRCS) >.depend
