# Makefile for CLISP module set zlib

srcdir = .
CC = gcc
CPPFLAGS = -I/usr/pkg/include -Dz_off_t=long -I/usr/include
CFLAGS = -O2 -fno-builtin-calloc -fno-builtin-malloc -fno-builtin-memalign -fno-builtin-realloc -fno-builtin-valloc -fno-builtin-free -I/usr/pkg/include -I/usr/include -I/usr/pkg/include/glib-2.0 -I/usr/pkg/include/gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include -Dz_off_t=long -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wmissing-declarations -O -DNO_SINGLEMAP -DNO_TRIVIALMAP -DENABLE_UNICODE -DDYNAMIC_FFI -DDYNAMIC_MODULES -I. -fPIC
CLISP = /usr/pkg/bin/clisp -norc -q
CLISP_LINKKIT = /usr/pkg/lib/clisp/linkkit

LN = ln

MAKE = make

SHELL = /bin/sh

GENERATED = zlib.o zlib.fas
DISTRIBFILES = link.sh Makefile $(GENERATED) $(srcdir)/zlib.lisp
distribdir =

# default target: make the module
clisp-module : $(GENERATED)

zlib.c zlib.fas : $(srcdir)/zlib.lisp
	$(CLISP) -c $(srcdir)/zlib.lisp -o ./

zlib.o : zlib.c config.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -I$(CLISP_LINKKIT) -c zlib.c

# Make a module distribution into $(distribdir)
clisp-module-distrib : clisp-module force
	$(LN) $(DISTRIBFILES) $(distribdir)

clean : force
	rm -f core *.o *.a *.fas *.lib

distclean : clean

force :

