
PLATFORM =
CC       = gcc
CPPFLAGS = -DOPENPKG_$(PLATFORM)=1
CFLAGS   = -Wall -fpic
LD       = gcc
LDFLAGS  = -shared
LIBS     = 
MFLAGS   = -f sweep.mk

all: freebsd

freebsd:
	$(MAKE) $(MFLAGS) sweep.so PLATFORM=FREEBSD
linux:
	$(MAKE) $(MFLAGS) sweep.so PLATFORM=LINUX LIBS="-ldl"
solaris:
	$(MAKE) $(MFLAGS) sweep.so PLATFORM=SOLARIS

sweep.o: sweep.c
	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o sweep.o sweep.c

sweep.so: sweep.o
	$(LD) $(LDFLAGS) -o sweep.so sweep.o $(LIBS)

clean:
	rm -f sweep.so sweep.o

