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
))
15 PROGS
= test whiptail whiptcl.so testgrid testtree
17 NDIALOGOBJS
= whiptail.o dialogboxes.o
18 WHIPTCLOBJS
= whiptcl.o dialogboxes.o
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 \
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
36 #--------------------------------------
38 SOURCES
= $(subst .o
,.c
,$(TESTOBJS
) $(NDIALOGOBJS
) $(LIBOBJS
))
41 SHAREDOBJS
= $(patsubst %,$(SHAREDDIR
)/%, $(LIBOBJS
))
43 ifeq (.depend
,$(wildcard .depend
))
46 TARGET
=depend
$(PROGS
)
49 all: $(TARGET
) _snackmodule.so
51 test: $(TESTOBJS
) $(LIBNEWT
)
52 gcc
-g
-o
test $(TESTOBJS
) $(LIBNEWT
) $(LIBS
) -static
54 testgrid
: testgrid.o
$(LIBNEWT
)
55 gcc
-g
-o testgrid testgrid.o
$(LIBNEWT
) $(LIBS
)
57 testtree
: testtree.o
$(LIBNEWT
)
58 gcc
-g
-o testtree testtree.o
$(LIBNEWT
) $(LIBS
)
60 _snackmodule.so
: snackmodule.o
$(LIBNEWTSH
)
61 gcc
--shared
$(SHCFLAGS
) -o _snackmodule.so snackmodule.o
-L .
$(LIBNEWTSH
)
63 snackmodule.o
: snackmodule.c
64 gcc
-I
/usr
/include/python1.5
-fPIC
$(CFLAGS
) -c snackmodule.c
66 whiptail
: $(NDIALOGOBJS
) $(LIBNEWTSH
)
67 gcc
-g
-o whiptail
$(NDIALOGOBJS
) -L .
$(LIBNEWTSH
) $(LIBS
) -lpopt
69 whiptcl.so
: $(WHIPTCLOBJS
) $(LIBNEWTSH
)
70 gcc
-shared
$(SHCFLAGS
) -o whiptcl.so
$(WHIPTCLOBJS
) -L .
$(LIBNEWTSH
) -ltcl
-lslang
-lpopt
-lm
72 $(LIBNEWT
): $(LIBNEWT
)($(LIBOBJS
))
74 newt.o
: newt.c Makefile
75 $(CC
) $(CFLAGS
) -DVERSION
=\"$(VERSION
)\" -c
-o
$@
$<
81 rm -f
$(PROGS
) *.o
$(LIBNEWT
) core
$(LIBNEWTSH
) \
85 $(CPP
) $(CFLAGS
) -M
$(SOURCES
) > .depend
90 sharedlib
: $(LIBNEWTSH
)
92 $(LIBNEWTSH
): $(SHAREDDIR
) $(SHAREDOBJS
)
93 gcc
-shared
-o
$(LIBNEWTSH
) -Wl
,-soname
,$(LIBNEWTSONAME
) $(SHAREDOBJS
) $(SHLIBS
)
95 $(SHAREDDIR
)/%.o
: %.c
96 $(CC
) $(SHCFLAGS
) -c
$(CFLAGS
) -o
$@
$<
98 $(SHAREDDIR
)/newt.o
: newt.c Makefile
99 $(CC
) $(SHCFLAGS
) $(CFLAGS
) -DVERSION
=\"$(VERSION
)\" -c
-o
$@
$<
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)
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
)
119 configure
: configure.in
121 echo
"You need to rerun ./configure before continuing"
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
134 @echo
"The final archive is ./newt-$(VERSION).tar.gz."
136 ifeq (.depend
,$(wildcard .depend
))