# Makefile for example Palace server plugin

# C compiler
CC = gcc

CFLAGS = -g -O2

API_HEADERS =        \
    config.h         \
    local.h          \
    m-assets.h       \
    m-events.h       \
    m-protocol.h     \
    maccompat.h      \
    mansion.h        \
    s-pluginapi.h    \
    s-serverpublic.h

TARGET = example

all: $(TARGET).so

clean: 
	rm -rf example.so

# Link options to generate a shared library.
# Comment and uncomment as appropriate for your system
#
# On Solaris or Linux (which use ELF), this should be:
#
LINKFLAGS = -Xlinker -G
#
# On OSF Unix (which uses COFF), this should be:
#
#LINKFLAGS = -shared
#
# Note that the OSF linker will give you undefined symbol warnings for all the
# server entry points you have referenced. This is to be expected and is
# benign -- though you may wish to look at the list for symbols that really
# *are* undefined (e.g., typos).

$(TARGET).so: $(TARGET).c $(API_HEADERS)
	$(CC) $(LINKFLAGS) $(CFLAGS) $< -o $@
