]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
Fixed Makefile so that shared library gets remade only if files change
authorsopwith <sopwith>
Wed, 30 Jul 1997 15:27:08 +0000 (15:27 +0000)
committersopwith <sopwith>
Wed, 30 Jul 1997 15:27:08 +0000 (15:27 +0000)
(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.

Makefile
listbox.c

index b2defb5b97e1104440dc876dfa27f1a1cd1f4b3d..ca56d8bce89aabfebfbf821c193f66bfcf7c44ee 100644 (file)
--- 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
index 2a9d90d4af4b3994f382ebd5687e83c8bb438a33..23258d928f15648a7e33c6324b4b03dbeca01d92 100644 (file)
--- a/listbox.c
+++ b/listbox.c
@@ -1,7 +1,7 @@
 /* This goofed-up box whacked into shape by Elliot Lee <sopwith@cuc.edu>
    (from the original listbox by Erik Troan <ewt@redhat.com>)
    and contributed to newt for use under the LGPL license.
-   Copyright Elliot Lee 1996 */
+   Copyright (C) 1996, 1997 Elliot Lee */
 
 #include <slang/slang.h>
 #include <stdio.h>
@@ -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;