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