# Makefile of GDBM for mingw
srcdir = ../..
winsrcdir = ..

CC = gcc -mno-cygwin
AR = ar
ARFLAGS = rcs
RM = rm -f
CP = cp
MV = mv

CFLAGS = -Os
LOCAL_CFLAGS = 
CPPFLAGS = 

ifeq ($(DLL), 0)
  LOCAL_DEFS = -DGDBM_STATIC
  LIBS = -lgdbm-statlic
else
  LOCAL_DEFS = 
  LIBS = -lgdbm
endif

prefix = /usr/local
exec_prefix = $(prefix)

bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
mandir = $(prefix)/man
includedir = $(prefix)/include

infodir = $(prefix)/info

man3dir = $(mandir)/man3


DEFS =

# For libraries which include headers from other libraries.
INCLUDES = -I$(winsrcdir) -I$(srcdir) -I$(includedir)

CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES:/=\) $(LOCAL_CFLAGS) $(CFLAGS)

.c.o:
	$(CC) -c $(CCFLAGS) $<

# The name of the main library target.

EXAMPLES = dbmtest.exe ndbmtest.exe gdbmtest.exe

##########

all: $(EXAMPLES)

dbmtest.exe: dbmtest.o
	$(CC) $(CCFLAGS) -o $@ dbmtest.o $(LIBS)

ndbmtest.exe: ndbmtest.o
	$(CC) $(CCFLAGS) -o $@ ndbmtest.o $(LIBS)

gdbmtest.exe: gdbmtest.o
	$(CC) $(CCFLAGS) -o $@ gdbmtest.o $(LIBS)

force: nul

clean:	force
	$(RM) *.o $(EXAMPLES) testdb*
