From: sopwith Date: Wed, 30 Jul 1997 15:27:08 +0000 (+0000) Subject: Fixed Makefile so that shared library gets remade only if files change X-Git-Tag: r0-12~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad7923517946c9fac4fcfb842cf479c267d5c907;p=thirdparty%2Fnewt.git Fixed Makefile so that shared library gets remade only if files change (before, was getting remade all the time because of the shared/ directory) Undid listbox's newtListboxAddEntry buboo that I added, newtListboxInsert() doesn't work right if only one item in list. --- diff --git a/Makefile b/Makefile index b2defb5..ca56d8b 100644 --- a/Makefile +++ b/Makefile @@ -60,12 +60,12 @@ clean: depend: $(CPP) $(CFLAGS) -M $(SOURCES) > .depend -shareddir: - mkdir -p shared +$(SHAREDDIR): + mkdir -p $(SHAREDDIR) -shared: $(LIBNEWTSH) +sharedlib: $(LIBNEWTSH) -$(LIBNEWTSH): shareddir $(SHAREDOBJS) +$(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS) gcc -shared -o $(LIBNEWTSH) -Wl,-soname,$(LIBNEWTSONAME) $(SHAREDOBJS) $(LIBS) $(SHAREDDIR)/%.o : %.c @@ -83,7 +83,7 @@ install: $(LIBNEWT) install -m 644 $(LIBNEWT) $(libdir) install -s -m 755 whiptail $(bindir) -install-sh: shared +install-sh: sharedlib install -m 755 $(LIBNEWTSH) $(libdir) ln -sf $(LIBNEWTSH) $(libdir)/libnewt.so /sbin/ldconfig diff --git a/listbox.c b/listbox.c index 2a9d90d..23258d9 100644 --- a/listbox.c +++ b/listbox.c @@ -1,7 +1,7 @@ /* This goofed-up box whacked into shape by Elliot Lee (from the original listbox by Erik Troan ) and contributed to newt for use under the LGPL license. - Copyright Elliot Lee 1996 */ + Copyright (C) 1996, 1997 Elliot Lee */ #include #include @@ -241,9 +241,6 @@ void newtListboxSetData(newtComponent co, int num, void * data) { int newtListboxAddEntry(newtComponent co, char * text, void * data) { struct listbox * li = co->data; -#if 1 - newtListboxInsertEntry(co, text, data, li->numItems + 1); -#else struct items *item; if(li->boxItems) { @@ -273,7 +270,6 @@ int newtListboxAddEntry(newtComponent co, char * text, void * data) { listboxDraw(co); return li->numItems; -#endif } @@ -286,7 +282,7 @@ int newtListboxInsertEntry(newtComponent co, char * text, void * data, num = li->numItems; if (li->boxItems) { - if(num > 1) { + if(num > 0) { for(i = 0, item = li->boxItems; item->next != NULL && i < num - 1; item = item->next, i++); t = item->next;