1 LIBS
= -lslang
-lm @LIBS@
#-lefence
2 SHLIBS
= -lslang
-lm
-lc @LIBS@
4 CFLAGS
= $(RPM_OPT_FLAGS
) -Wall
-I
/usr
/include/slang
5 ifeq ($(RPM_OPT_FLAGS
),)
6 CFLAGS
+= -g
# -O2 -I/usr/include/slang
10 CVSTAG
= r
$(subst .
,-,$(VERSION
))
13 PROGS
= test whiptail whiptcl.so testgrid
15 NDIALOGOBJS
= whiptail.o dialogboxes.o
16 WHIPTCLOBJS
= whiptcl.o dialogboxes.o
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
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
33 #--------------------------------------
35 SOURCES
= $(subst .o
,.c
,$(TESTOBJS
) $(NDIALOGOBJS
) $(LIBOBJS
))
38 SHAREDOBJS
= $(patsubst %,$(SHAREDDIR
)/%, $(LIBOBJS
))
40 ifeq (.depend
,$(wildcard .depend
))
43 TARGET
=depend
$(PROGS
)
46 all: $(TARGET
) _snackmodule.so
48 test: $(TESTOBJS
) $(LIBNEWT
)
49 gcc
-g
-o
test $(TESTOBJS
) $(LIBNEWT
) $(LIBS
) -static
51 testgrid
: testgrid.o
$(LIBNEWT
)
52 gcc
-g
-o testgrid testgrid.o
$(LIBNEWT
) $(LIBS
)
54 _snackmodule.so
: snackmodule.o
$(LIBNEWTSH
)
55 gcc
--shared
-o _snackmodule.so snackmodule.o
-L .
$(LIBNEWTSH
)
57 snackmodule.o
: snackmodule.c
58 gcc
-I
/usr
/include/python1.5
-fPIC
$(CFLAGS
) -c snackmodule.c
60 whiptail
: $(NDIALOGOBJS
) $(LIBNEWTSH
)
61 gcc
-g
-o whiptail
$(NDIALOGOBJS
) -L .
$(LIBNEWTSH
) $(LIBS
) -lpopt
63 whiptcl.so
: $(WHIPTCLOBJS
) $(LIBNEWTSH
)
64 gcc
-shared
-o whiptcl.so
$(WHIPTCLOBJS
) -L .
$(LIBNEWTSH
) -ltcl
-lslang
-lpopt
-lm
66 $(LIBNEWT
): $(LIBNEWT
)($(LIBOBJS
))
68 newt.o
: newt.c Makefile
69 $(CC
) $(CFLAGS
) -DVERSION
=\"$(VERSION
)\" -c
-o
$@
$<
75 rm -f
$(PROGS
) *.o
$(LIBNEWT
) core
$(LIBNEWTSH
) \
79 $(CPP
) $(CFLAGS
) -M
$(SOURCES
) > .depend
84 sharedlib
: $(LIBNEWTSH
)
86 $(LIBNEWTSH
): $(SHAREDDIR
) $(SHAREDOBJS
)
87 gcc
-shared
-o
$(LIBNEWTSH
) -Wl
,-soname
,$(LIBNEWTSONAME
) $(SHAREDOBJS
) $(SHLIBS
)
89 $(SHAREDDIR
)/%.o
: %.c
90 $(CC
) $(SHCFLAGS
) -c
$(CFLAGS
) -o
$@
$<
92 $(SHAREDDIR
)/newt.o
: newt.c Makefile
93 $(CC
) $(SHCFLAGS
) $(CFLAGS
) -DVERSION
=\"$(VERSION
)\" -c
-o
$@
$<
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)
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
)
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
122 @echo
"The final archive is ./newt-$(VERSION).tar.gz."
124 ifeq (.depend
,$(wildcard .depend
))