#----------------------------------------------------------------------
#                         Makefile to build libmmap
#                 Copyright (c) 2008 American Megatrends Inc 
#-----------------------------------------------------------------------

#------- Comment/uncomment the following line to enable/disable debugging------
DEBUG 		= n
#------------------------------------------------------------------------------


#---------------------- Generic Library variables -----------------------------
# Versions for the library
LIB_VER_MAJOR	= 1
LIB_VER_MINOR	= 0

LIBRARY_NAME	= libmmap
#------------------------------------------------------------------------------


#---------------------- Compute TOPDIR and include Rules file -----------------
ifndef TOPDIR
TOPDIR  := $(shell cd ../../../../..; pwd)
endif
include $(TOPDIR)/development/rules/Rules.make.libs
#------------------------------------------------------------------------------


#---------------------- Change according to your files ------------------------
# Source files
SRC		=  mmap.c

#------------------------------------------------------------------------------
CFLAGS += -fno-strict-aliasing

#--------------WARNING : Donot Modify anything below this line ----------------

all: $(LIB_LINKERNAME) install

docs:
	doxygen

$(LIB_ARCHIVE_NAME): $(SRC:.c=.o)
	$(AR) $(ARFLAGS) $@ $^

$(LIB_LINKERNAME):$(LIB_REALNAME)
	ln -sf $(LIB_REALNAME) $(LIB_LINKERNAME)


$(LIB_REALNAME):$(LIB_ARCHIVE_NAME)
	$(CC) -shared -Wl,-soname,$(LIB_SONAME) -o $(LIB_REALNAME) \
	-Wl,--whole-archive $(LIB_ARCHIVE_NAME) -Wl,--no-whole-archive -lc

extrainstall:

clean:
	rm -f *.o *~ core .depend $(TARGET) *.lcd
	rm -f $(LIB_LINKERNAME) $(LIB_COMMON_LIBNAME) $(LIB_REALNAME)

lint:
	$(LINT) $(LFLAGS) $(SRC)


ifeq (.depend,$(wildcard .depend))
include .depend
endif
#------------------------------------------------------------------------------
