]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
added version number, libnewt.a generation, archive and install rules
authorewt <ewt>
Sun, 31 Mar 1996 02:47:32 +0000 (02:47 +0000)
committerewt <ewt>
Sun, 31 Mar 1996 02:47:32 +0000 (02:47 +0000)
Makefile

index 8162326e6503cff45fc5e1325c59e54bd0c70b28..3c5643e63888ce4cc6493e2b62502afd8d9586d5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,21 @@
-OBJS = newt.o test.o button.o form.o checkbox.o entry.o label.o listbox.o \
-       scrollbar.o
-LIBS = -lslang -lm -lefence
+LIBS = -L. -lnewt -lslang -lm -lefence
 CFLAGS = -g -Wall
 
+VERSION = 0.1
+
 PROGS = test
+OBJS = test.o
+LIBNEWT = libnewt.a
+LIBOBJS = newt.o button.o form.o checkbox.o entry.o label.o listbox.o \
+          scrollbar.o
+
+prefix = /usr
+includedir = $(prefix)/include
+libdir = $(prefix)/lib
 
-SOURCES = $(subst .o,.c,$(OBJS))
+#--------------------------------------
+
+SOURCES = $(subst .o,.c,$(OBJS) $(LIBOBJS)) 
 
 ifeq (.depend,$(wildcard .depend))
 TARGET=$(PROGS)
@@ -15,18 +25,46 @@ endif
 
 all:   $(TARGET)
 
-test:  $(OBJS)
+test:  $(OBJS) $(LIBNEWT)
        gcc -g -o test $(OBJS) $(LIBS)
 
+$(LIBNEWT): $(LIBNEWT)($(LIBOBJS))
+
+newt.o: newt.c Makefile
+       $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $<
+
 veryclean: clean
        rm -f .depend
 
 clean:
-       rm -f $(PROGS) $(OBJS) core
+       rm -f $(PROGS) $(OBJS) $(LIBOBJS) $(LIBNEWT) core
 
 depend:
        $(CPP) $(CFLAGS) -M $(SOURCES) > .depend
 
+install:
+       install -m 755 -o 0 -g 0 -d $(libdir)
+       install -m 755 -o 0 -g 0 -d $(includedir)
+       install -m 644 -o 0 -g 0 newt.h $(includedir)
+       install -m 644 -o 0 -g 0 $(LIBNEWT) $(libdir)
+
+archive: 
+       @rm -rf /tmp/newt-$(VERSION)
+       @mkdir /tmp/newt-$(VERSION)
+       @tar cSpf - * | (cd /tmp/newt-$(VERSION); tar xSpf -)
+       @cd /tmp/newt-$(VERSION); \
+           make clean; \
+           find . -name "RCS" -exec rm {} \;  ; \
+           find . -name ".depend" -exec rm {} \;  ; \
+           rm -f *gz test
+       @cd /tmp; tar czSpf newt-$(VERSION).tar.gz newt-$(VERSION)
+       @rm -rf /tmp/newt-$(VERSION)
+       @cp /tmp/newt-$(VERSION).tar.gz .
+       @rm -f /tmp/newt-$(VERSION).tar.gz 
+       @echo " "
+       @echo "The final archive is ./newt-$(VERSION).tar.gz. You should run"
+       @echo "-n$(VERSION): RCS/*,v on all of the directories btw."
+
 ifeq (.depend,$(wildcard .depend))
 include .depend
 endif