CFLAGS += -I. -Wall -DPANELS_WORK=1 -DDYNAMIC_BINDING=1
CXXFLAGS=$(CFLAGS)

LIBNAME=nd
MAJOR=1
MINOR=0

# a.out shared library information (if I ever get the goddamn
# a.out shared library generation tools to actually work.)

DLL_ADDR=0x66600000
DLL_JUMPSIZE=0x4000
DLL_GOTSIZE=0x4000


SRCS=nd_objects.c ndmenu.c ndwin.c ndedit.c ndutil.c dialog.c nderror.c \
     ndialog.c yesno.c objchain.c lists.c html.c renderer.c text_obj.c \
     ndhelp.c list_widget.c indexed_menu.c
HEADERS= dialog.h ndialog.h
HDIR=nd
HFILES= indexed_menu.h

LIBES=-lnd_g -lpanel -lncurses

all clean spotless install: .depend
	CC= INSTALL_LIB=$(DESTDIR)/usr/ia32-linuxaout/lib \
	    $(MAKE) FORMAT="aout" $@-
#	CC= $(MAKE) FORMAT="elf" $@-

include ../Make.library
-include .depend

test:
	FORMAT="aout" INSTALL_LIB=$(DESTDIR)/usr/ia32linuxaout/lib \
		     $(MAKE) $@-

all-: $(TARGETS)

test-:	testhtml testprog testobj mt testdialog testhtml lwb #withdialog

spotless-: clean-
	rm -fr obj shared debug nd.tar.gz

clean-: libclean testclean

testclean:
	rm -fr *.o testhtml testobj testprog testdialog mt

mt: mt.o $(TARGETS)
	$(CC) $(LFLAGS) -o mt mt.o $(LIBES)

testobj: testobj.c $(TARGETS)
	$(CC) -g $(CFLAGS) $(LFLAGS) -o testobj testobj.c $(LIBES)

lwb: lwb.c $(TARGETS)
	$(CC) -g $(CFLAGS) $(LFLAGS) -o lwb lwb.c $(LIBES)

testprog: testprog.c $(TARGETS)
	$(CC) -g $(CFLAGS) $(LFLAGS) -o testprog testprog.c $(LIBES)

testdialog: testdialog.c $(TARGETS)
	$(CC) -g $(CFLAGS) $(LFLAGS) -o testdialog testdialog.c $(LIBES)

testhtml: testhtml.c $(TARGETS)
	$(CC) -g $(CFLAGS) $(LFLAGS) -o testhtml testhtml.c $(LIBES)

build_install: all
	@-mkdir -p ../include/nd
	install -c -m 444 $(HEADERS) ../include
	install -c -m 444 $(HFILES) ../include/nd

install-: $(TARGETS) lib-install man-install hdr-install

tarball: $(SOURCES) Makefile testprog.c testdialog.c testobj.c mt.c
	tar czvf nd.tar.gz *.c *.h Makefile

.depend: $(SRCS)
	$(CC) -I. -MM $(SRCS) > .depend
