1 LIBS
= -lslang
-lm
#-lefence
2 SHLIBS
= -lslang
-lm
-lc
4 GPM_SUPPORT
=@gpm_support@
6 CFLAGS
= $(RPM_OPT_FLAGS
) -Wall
-I
/usr
/include/slang
7 ifeq ($(RPM_OPT_FLAGS
),)
8 CFLAGS
+= -g
# -O2 -I/usr/include/slang
12 CVSTAG
= r
$(subst .
,-,$(VERSION
))
18 PROGS
= test whiptail
$(WHIPTCLSO
) testgrid testtree
20 NDIALOGOBJS
= whiptail.o dialogboxes.o
21 WHIPTCLOBJS
= whiptcl.o dialogboxes.o
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 \
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
39 #--------------------------------------
41 SOURCES
= $(subst .o
,.c
,$(TESTOBJS
) $(NDIALOGOBJS
) $(LIBOBJS
))
44 SHAREDOBJS
= $(patsubst %,$(SHAREDDIR
)/%, $(LIBOBJS
))
46 ifeq (.depend
,$(wildcard .depend
))
49 TARGET
=depend
$(PROGS
)
52 all: $(TARGET
) _snackmodule.so
54 test: $(TESTOBJS
) $(LIBNEWT
)
55 gcc
-g
-o
test $(TESTOBJS
) $(LIBNEWT
) $(LIBS
) -static
57 testgrid
: testgrid.o
$(LIBNEWT
)
58 gcc
-g
-o testgrid testgrid.o
$(LIBNEWT
) $(LIBS
)
60 testtree
: testtree.o
$(LIBNEWT
)
61 gcc
-g
-o testtree testtree.o
$(LIBNEWT
) $(LIBS
)
63 _snackmodule.so
: snackmodule.o
$(LIBNEWTSH
)
64 gcc
--shared
$(SHCFLAGS
) -o _snackmodule.so snackmodule.o
-L .
$(LIBNEWTSH
)
66 snackmodule.o
: snackmodule.c
67 gcc
-I
/usr
/include/python2.2
-fPIC
$(CFLAGS
) -c snackmodule.c
69 whiptail
: $(NDIALOGOBJS
) $(LIBNEWTSH
)
70 gcc
-g
-o whiptail
$(NDIALOGOBJS
) -L .
$(LIBNEWTSH
) $(LIBS
) -lpopt
72 whiptcl.so
: $(WHIPTCLOBJS
) $(LIBNEWTSH
)
73 gcc
-shared
$(SHCFLAGS
) -o whiptcl.so
$(WHIPTCLOBJS
) -L .
$(LIBNEWTSH
) -ltcl
-lslang
-lpopt
-lm
75 $(LIBNEWT
): $(LIBNEWT
)($(LIBOBJS
))
77 newt.o
: newt.c Makefile
78 $(CC
) $(CFLAGS
) -DVERSION
=\"$(VERSION
)\" -c
-o
$@
$<
84 rm -f
$(PROGS
) *.o
$(LIBNEWT
) core
$(LIBNEWTSH
) \
88 $(CPP
) $(CFLAGS
) -M
$(SOURCES
) > .depend
93 sharedlib
: $(LIBNEWTSH
)
95 $(LIBNEWTSH
): $(SHAREDDIR
) $(SHAREDOBJS
)
96 gcc
-shared
-o
$(LIBNEWTSH
) -Wl
,-soname
,$(LIBNEWTSONAME
) $(SHAREDOBJS
) $(SHLIBS
)
98 $(SHAREDDIR
)/%.o
: %.c
99 $(CC
) $(SHCFLAGS
) -c
$(CFLAGS
) -o
$@
$<
101 $(SHAREDDIR
)/newt.o
: newt.c Makefile
102 $(CC
) $(SHCFLAGS
) $(CFLAGS
) -DVERSION
=\"$(VERSION
)\" -c
-o
$@
$<
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)
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
)
122 configure
: configure.in
124 echo
"You need to rerun ./configure before continuing"
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
137 @echo
"The final archive is ./newt-$(VERSION).tar.gz."
139 ifeq (.depend
,$(wildcard .depend
))