From: ewt Date: Sun, 31 Mar 1996 02:47:32 +0000 (+0000) Subject: added version number, libnewt.a generation, archive and install rules X-Git-Tag: 0-1~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6652324cba986234ec260c294b179e26c67bbf9e;p=thirdparty%2Fnewt.git added version number, libnewt.a generation, archive and install rules --- diff --git a/Makefile b/Makefile index 8162326..3c5643e 100644 --- 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