]> git.ipfire.org Git - thirdparty/newt.git/blob - Makefile.in
Last make archive fix, updated spec file
[thirdparty/newt.git] / Makefile.in
1 LIBS = -lslang -lm @LIBS@ #-lefence
2 SHLIBS = -lslang -lm -lc @LIBS@
3
4 CFLAGS = $(RPM_OPT_FLAGS) -Wall -I/usr/include/slang
5 ifeq ($(RPM_OPT_FLAGS),)
6 CFLAGS += -g # -O2 -I/usr/include/slang
7 endif
8
9 VERSION = @VERSION@
10 CVSTAG = r$(subst .,-,$(VERSION))
11 SONAME = @VERSION@
12
13 PROGS = test whiptail whiptcl.so testgrid
14 TESTOBJS = test.o
15 NDIALOGOBJS = whiptail.o dialogboxes.o
16 WHIPTCLOBJS = whiptcl.o dialogboxes.o
17 LIBNEWT = libnewt.a
18 LIBNEWTSH = libnewt.so.$(VERSION)
19 LIBNEWTSONAME = libnewt.so.$(SONAME)
20 LIBOBJS = newt.o button.o form.o checkbox.o entry.o label.o listbox.o \
21 scrollbar.o textbox.o scale.o grid.o windows.o buttonbar.o
22
23 SHCFLAGS = -fPIC
24
25 prefix = /usr
26 includedir = $(prefix)/include
27 libdir = $(prefix)/lib
28 bindir = $(prefix)/bin
29 ARCHNAME = $(shell uname -m | sed 's/i.86/i386/')
30 pythondir = $(prefix)/lib/python1.5
31 pythonbindir = $(prefix)/lib/python1.5/lib-dynload
32
33 #--------------------------------------
34
35 SOURCES = $(subst .o,.c,$(TESTOBJS) $(NDIALOGOBJS) $(LIBOBJS))
36
37 SHAREDDIR = shared
38 SHAREDOBJS = $(patsubst %,$(SHAREDDIR)/%, $(LIBOBJS))
39
40 ifeq (.depend,$(wildcard .depend))
41 TARGET=$(PROGS)
42 else
43 TARGET=depend $(PROGS)
44 endif
45
46 all: $(TARGET) _snackmodule.so
47
48 test: $(TESTOBJS) $(LIBNEWT)
49 gcc -g -o test $(TESTOBJS) $(LIBNEWT) $(LIBS) -static
50
51 testgrid: testgrid.o $(LIBNEWT)
52 gcc -g -o testgrid testgrid.o $(LIBNEWT) $(LIBS)
53
54 _snackmodule.so: snackmodule.o $(LIBNEWTSH)
55 gcc --shared -o _snackmodule.so snackmodule.o -L . $(LIBNEWTSH)
56
57 snackmodule.o: snackmodule.c
58 gcc -I/usr/include/python1.5 -fPIC $(CFLAGS) -c snackmodule.c
59
60 whiptail: $(NDIALOGOBJS) $(LIBNEWTSH)
61 gcc -g -o whiptail $(NDIALOGOBJS) -L . $(LIBNEWTSH) $(LIBS) -lpopt
62
63 whiptcl.so: $(WHIPTCLOBJS) $(LIBNEWTSH)
64 gcc -shared -o whiptcl.so $(WHIPTCLOBJS) -L . $(LIBNEWTSH) -ltcl -lslang -lpopt -lm
65
66 $(LIBNEWT): $(LIBNEWT)($(LIBOBJS))
67
68 newt.o: newt.c Makefile
69 $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $<
70
71 veryclean: clean
72 rm -f .depend
73
74 clean:
75 rm -f $(PROGS) *.o $(LIBNEWT) core $(LIBNEWTSH) \
76 $(SHAREDOBJS) *.so*
77
78 depend:
79 $(CPP) $(CFLAGS) -M $(SOURCES) > .depend
80
81 $(SHAREDDIR):
82 mkdir -p $(SHAREDDIR)
83
84 sharedlib: $(LIBNEWTSH)
85
86 $(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS)
87 gcc -shared -o $(LIBNEWTSH) -Wl,-soname,$(LIBNEWTSONAME) $(SHAREDOBJS) $(SHLIBS)
88
89 $(SHAREDDIR)/%.o : %.c
90 $(CC) $(SHCFLAGS) -c $(CFLAGS) -o $@ $<
91
92 $(SHAREDDIR)/newt.o: newt.c Makefile
93 $(CC) $(SHCFLAGS) $(CFLAGS) -DVERSION=\"$(VERSION)\" -c -o $@ $<
94
95
96 install: $(LIBNEWT) whiptail
97 [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir)
98 [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir)
99 [ -d $(instroot)/$(includedir) ] || install -m 755 -d $(instroot)/$(includedir)
100 install -m 644 newt.h $(instroot)/$(includedir)
101 install -m 644 $(LIBNEWT) $(instroot)/$(libdir)
102 install -s -m 755 whiptail $(instroot)/$(bindir)
103
104 install-sh: sharedlib whiptcl.so _snackmodule.so
105 install -m 755 $(LIBNEWTSH) $(instroot)/$(libdir)
106 ln -sf $(LIBNEWTSH) $(instroot)/$(libdir)/libnewt.so
107 install -m 755 whiptcl.so $(instroot)/$(libdir)
108 [ -d $(instroot)/$(pythonbindir) ] || install -m 755 -d $(instroot)/$(pythonbindir)
109 install -m 755 _snackmodule.so $(instroot)/$(pythonbindir)
110 install -m 755 snack.py $(instroot)/$(pythondir)
111
112 archive:
113 @cvs tag -F $(CVSTAG)
114 @rm -rf /tmp/newt-$(VERSION) /tmp/newt
115 @cd /tmp; cvs export -r$(CVSTAG) newt; mv newt newt-$(VERSION)
116 @cd /tmp/newt-$(VERSION); autoconf
117 @cd /tmp; tar czSpf newt-$(VERSION).tar.gz newt-$(VERSION)
118 @rm -rf /tmp/newt-$(VERSION)
119 @cp /tmp/newt-$(VERSION).tar.gz .
120 @rm -f /tmp/newt-$(VERSION).tar.gz
121 @echo " "
122 @echo "The final archive is ./newt-$(VERSION).tar.gz."
123
124 ifeq (.depend,$(wildcard .depend))
125 include .depend
126 endif