# Makefile for user metamodel

# Just typing 'make' will produce a shared object for your platform,
# and a model testing utility "testmodel". 

METAMODEL_NAME=avgdistance
PLATFORM=$(shell ./platform.sh)

all: umm_$(METAMODEL_NAME)_$(PLATFORM).so testmodel

umm_$(METAMODEL_NAME)_$(PLATFORM).so: $(METAMODEL_NAME).c
	gcc -g -shared -fPIC -Wall -Wfatal-errors -nostartfiles -o $@ $<

testmodel: testmodel.c
	gcc -g -o testmodel -Wall -Wfatal-errors testmodel.c -ldl

clean: 
	rm -f testmodel umm_$(METAMODEL_NAME)_*.so

test: all
	testmodel $(METAMODEL_NAME)