SHELL=/bin/sh

INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@

top_srcdir=@top_srcdir@
srcdir=@srcdir@
VPATH=@srcdir@

CC=@CC@
CPPFLAGS=@CPPFLAGS@
DEFS=@DEFS@
CFLAGS=@CFLAGS@
MODULE_CFLAGS=@MODULE_CFLAGS@
X_CFLAGS=@X_CFLAGS@
ALL_CFLAGS=-I$(top_srcdir) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(MODULE_CFLAGS) $(X_CFLAGS)
LDFLAGS=@MODULE_LDFLAGS@

RM=rm -f

.SUFFIXES: .so

SRCS=	string.c icon.c
OBJS=	string.o icon.o
SOBJS=	string.so icon.so

all: $(SOBJS)

.c.so:
	$(CC) -c -I. -I$(srcdir) $(ALL_CFLAGS) $<
	$(LD) $(LDFLAGS) -o $@ $*.o

clean:
	-$(RM) $(OBJS) $(SOBJS)
	-$(RM) *~ so_locations

distclean: clean
	-$(RM) Makefile

install: all
	${top_srcdir}/mkinstalldirs $(DESTDIR)$(libdir)/nawm
	for so in $(SOBJS); do $(INSTALL) -m 755 $$so $(DESTDIR)$(libdir)/nawm; done
