#
# The output of the make process will be extendedplugin.so
#
# This makefile contains some defines
#
# PLUGIN_API_INCLUDE_DIR
# Points to the directory where the plugin include files are.

# GOGI_API_INCLUDE_DIR
# Points to the directoy containing the Opera GOGI SDK header files.
# 
# CROSS
# Cross compiler suffix used (if any).
#
# In order for this makefile to work you must set GOGI_API_INCLUDE_DIR
# to point to the directory containing the GOGI header files and
# PLUGIN_API_INCLUDE_DIR to point to the directory containing the plugin API
# header files.
#
# Note that if the plugin API header files are to old they won't contain all
# the API:s needed to be able to compile the plugin.

PLUGIN=extendedplugin.so
PLUGIN_API_INCLUDE_DIR?=../../include
GOGI_API_INCLUDE_DIR?=../../../include
CC=${CROSS}gcc
OPTIMIZER=-g
CFLAGS=$(OPTIMIZER) -fno-exceptions

ifeq ($(ARCHITECTURE:mipsel=mips), mips)
	CFLAGS += -fPIC
else
	CFLAGS += -fpic
endif

INCPATH=-I. -I$(GOGI_API_INCLUDE_DIR) -I$(PLUGIN_API_INCLUDE_DIR)

default all: $(PLUGIN)

$(PLUGIN): $(PLUGIN:.so=.c)
	$(CC) -g -o $@ $(CFLAGS) -shared $(INCPATH) $< npunix.c 

clean:
	rm -rf $(PLUGIN) *.o
