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