#
# The W Toolkit - Makefile
#

CC=gcc
CPPFLAGS=-I.
CFLAGS=-Wall -O -g
AR=ar
RANLIB=ar s
INSTALL=install

INCDIR=/usr/include
LIBDIR=/usr/lib

LIBS=libWt.a # blibWt.a

OBJS=toolkit.o draw3d.o \
  top.o shell.o button.o box.o pane.o drawable.o scrollbar.o \
  viewport.o form.o iconedit.o html.o getstring.o

BOBJS=toolkit.ob draw3d.ob \
  top.ob shell.ob button.ob box.ob pane.ob drawable.ob \
  scrollbar.ob viewport.ob form.ob iconedit.ob html.ob getstring.ob

.SUFFIXES: .ob

.c.ob:
	$(CC) $(CFLAGS) $(CPPFLAGS) -mbaserel -c $< -o $@


all: $(LIBS)

libWt.a: $(OBJS)
	$(AR) rc $@ $(OBJS)
	$(RANLIB) $@

blibWt.a: $(BOBJS)
	$(AR) rc $@ $(BOBJS)
	$(RANLIB) $@

install: $(LIBS)
	$(INSTALL) -m 644 Wt.h $(INCDIR)/
	$(INSTALL) -m 644 $(LIBS) $(LIBDIR)/

clean:
	rm -f *.o

distclean:
	rm -f *.o *.a
