2 LIBTCL
= @TCL_LIB_FLAG@
8 CPPFLAGS
= -D_GNU_SOURCE
-I
/usr
/include/slang @CPPFLAGS@
12 TAG
= r
$(subst .
,-,$(VERSION
))
16 PYTHONVERS
= @PYTHONVERS@
17 WHIPTCLLIB
= @WHIPTCLLIB@
18 ifneq ($(WHIPTCLLIB
),)
19 WHIPTCLSO
= $(WHIPTCLLIB
).
$(SOEXT
)
24 PROGS
= test whiptail
$(WHIPTCLSO
) testgrid testtree showchars showkey
25 TESTOBJS
= test.o testgrid.o testtree.o showchars.o showkey.o
26 NDIALOGOBJS
= whiptail.o dialogboxes.o
27 WHIPTCLOBJS
= shared
/whiptcl.o shared
/dialogboxes.o
29 LIBNEWTSH
= libnewt.
$(SOEXT
).
$(VERSION
)
30 LIBNEWTSONAME
= libnewt.
$(SOEXT
).
$(SONAME
)
31 LIBOBJS
= newt.o button.o form.o checkbox.o entry.o label.o listbox.o \
32 scrollbar.o textbox.o scale.o grid.o windows.o buttonbar.o \
36 SHLIBFLAGS
= -Wl
,--version-script
,newt
.0.52.ver
-Wl
,-soname
,$(LIBNEWTSONAME
)
44 includedir = @
includedir@
45 exec_prefix = @
exec_prefix@
49 datarootdir
= @datarootdir@
51 man1dir = $(mandir)/man1
52 pkgconfigdir
= $(libdir)/pkgconfig
53 instroot ?
= $(DESTDIR
)
55 #--------------------------------------
57 SOURCES
= $(subst .o
,.c
,$(TESTOBJS
) $(NDIALOGOBJS
) $(LIBOBJS
))
60 SHAREDOBJS
= $(patsubst %,$(SHAREDDIR
)/%, $(LIBOBJS
))
62 ifeq (.depend
,$(wildcard .depend
))
65 TARGET
=depend
$(PROGS
)
68 all: $(TARGET
) _snack.
$(SOEXT
)
70 test: test.o
$(LIBNEWT
)
71 $(CC
) -g
-o
test test.o
$(LIBNEWT
) $(LDFLAGS
) $(LIBS
)
73 testgrid
: testgrid.o
$(LIBNEWT
)
74 $(CC
) -g
-o testgrid testgrid.o
$(LIBNEWT
) $(LDFLAGS
) $(LIBS
)
76 testtree
: testtree.o
$(LIBNEWT
)
77 $(CC
) -g
-o testtree testtree.o
$(LIBNEWT
) $(LDFLAGS
) $(LIBS
)
79 showchars
: showchars.o
$(LIBNEWT
)
80 $(CC
) -g
-o showchars showchars.o
$(LIBNEWT
) $(LDFLAGS
) $(LIBS
)
82 showkey
: showkey.o
$(LIBNEWT
)
83 $(CC
) -g
-o showkey showkey.o
$(LIBNEWT
) $(LDFLAGS
) $(LIBS
)
85 _snack.
$(SOEXT
): snack.c
$(LIBNEWTSH
)
86 @
[ -n
"$(PYTHONVERS)" ] && for ver in
$(PYTHONVERS
); do \
87 pyconfig
=$$ver-config
; \
88 if
! $$pyconfig --cflags > /dev
/null
2>&1 && \
89 python-config
--cflags > /dev
/null
2>&1; then \
90 echo
$$pyconfig not found
, using python-config
; \
91 pyconfig
=python-config
; \
94 PCFLAGS
=`$$pyconfig --cflags`; \
95 PIFLAGS
=`$$pyconfig --includes`; \
96 PLDFLAGS
=`$$pyconfig --ldflags`; \
97 PLFLAGS
=`$$pyconfig --libs`; \
98 echo
$(CC
) $(SHCFLAGS
) $(CPPFLAGS
) $$PIFLAGS $$PCFLAGS -c
-o
$$ver/snack.o snack.c
; \
99 $(CC
) $(SHCFLAGS
) $(CPPFLAGS
) $$PIFLAGS $$PCFLAGS -c
-o
$$ver/snack.o snack.c
; \
100 echo
$(CC
) --shared
$$PLDFLAGS $$PLFLAGS $(LDFLAGS
) -o
$$ver/_snack.
$(SOEXT
) $$ver/snack.o
-L.
-lnewt
$(LIBS
); \
101 $(CC
) --shared
$$PLDFLAGS $$PLFLAGS $(LDFLAGS
) -o
$$ver/_snack.
$(SOEXT
) $$ver/snack.o
-L.
-lnewt
$(LIBS
); \
105 whiptail
: $(NDIALOGOBJS
) $(LIBNEWTSH
)
106 $(CC
) -g
-o whiptail
$(NDIALOGOBJS
) -L.
$(LDFLAGS
) -lnewt
$(LIBS
) -lpopt
108 whiptcl.
$(SOEXT
): $(WHIPTCLOBJS
) $(LIBNEWTSH
)
109 $(CC
) -shared
$(SHCFLAGS
) $(LDFLAGS
) -o whiptcl.
$(SOEXT
) $(WHIPTCLOBJS
) -L.
-lnewt
$(LIBTCL
) -lpopt
$(LIBS
)
111 $(LIBNEWT
): $(LIBOBJS
)
114 newt.o
$(SHAREDDIR
)/newt.o
: newt.c Makefile
120 rm -f
$(PROGS
) *.o
$(LIBNEWT
) core
$(LIBNEWTSH
) \
121 $(SHAREDDIR
)/*.o
*.
$(SOEXT
)*
124 $(CPP
) $(CFLAGS
) $(CPPFLAGS
) -M
$(SOURCES
) > .depend
127 mkdir
-p
$(SHAREDDIR
)
129 sharedlib
: $(LIBNEWTSH
)
131 $(LIBNEWTSH
): $(SHAREDDIR
) $(SHAREDOBJS
)
132 $(CC
) -shared
-o
$(LIBNEWTSH
) $(SHLIBFLAGS
) $(SHAREDOBJS
) $(LDFLAGS
) $(LIBS
)
133 ln
-fs
$(LIBNEWTSONAME
) libnewt.
$(SOEXT
)
134 ln
-fs
$(LIBNEWTSH
) $(LIBNEWTSONAME
)
136 $(SHAREDDIR
)/%.o
: %.c
137 $(CC
) $(SHCFLAGS
) -c
$(CFLAGS
) $(CPPFLAGS
) -o
$@
$<
139 install: $(LIBNEWT
) install-sh whiptail
140 [ -d
$(instroot
)/$(bindir) ] ||
install -m
755 -d
$(instroot
)/$(bindir)
141 [ -d
$(instroot
)/$(libdir) ] ||
install -m
755 -d
$(instroot
)/$(libdir)
142 [ -d
$(instroot
)/$(includedir) ] ||
install -m
755 -d
$(instroot
)/$(includedir)
143 [ -d
$(instroot
)/$(man1dir) ] ||
install -m
755 -d
$(instroot
)/$(man1dir)
144 [ -d
$(instroot
)/$(pkgconfigdir
) ] ||
install -m
755 -d
$(instroot
)/$(pkgconfigdir
)
145 install -m
644 newt.h
$(instroot
)/$(includedir)
146 install -m
644 $(LIBNEWT
) $(instroot
)/$(libdir)
147 install -m
755 whiptail
$(instroot
)/$(bindir)
148 install -m
644 whiptail
.1 $(instroot
)/$(man1dir)
149 make
-C po
datadir=$(instroot
)/$(datadir) install
150 install -m
644 libnewt.
pc $(instroot
)/$(pkgconfigdir
)
152 install-sh
: sharedlib
$(WHIPTCLSO
) _snack.
$(SOEXT
)
153 [ -d
$(instroot
)/$(libdir) ] ||
install -m
755 -d
$(instroot
)/$(libdir)
154 install -m
755 $(LIBNEWTSH
) $(instroot
)/$(libdir)
155 ln
-sf
$(LIBNEWTSONAME
) $(instroot
)/$(libdir)/libnewt.
$(SOEXT
)
156 ln
-sf
$(LIBNEWTSH
) $(instroot
)/$(libdir)/$(LIBNEWTSONAME
)
157 [ -n
"$(WHIPTCLSO)" ] && install -m
755 whiptcl.
$(SOEXT
) $(instroot
)/$(libdir) ||
:
158 [ -n
"$(PYTHONVERS)" ] && for ver in
$(PYTHONVERS
) ; do \
159 [ -d
$(instroot
)/$(libdir)/$$ver/site-packages
] ||
install -m
755 -d
$(instroot
)/$(libdir)/$$ver/site-packages
;\
160 install -m
755 $$ver/_snack.
$(SOEXT
) $(instroot
)/$(libdir)/$$ver/site-packages
;\
161 install -m
644 snack.py
$(instroot
)/$(libdir)/$$ver/site-packages
;\
164 Makefile
: configure.ac
165 echo
"You need to rerun ./autogen.sh and ./configure before continuing"
168 create-archive
: Makefile
169 @
rm -rf
/tmp
/newt-
$(VERSION
)
170 @git archive
--prefix=newt-
$(VERSION
)/ $(TAG
) |
tar x
-C
/tmp
171 @cd
/tmp
/newt-
$(VERSION
) && .
/autogen.sh
&& rm -rf autom4te.cache .tx .gitignore
172 @cd
/tmp
; tar czSpf newt-
$(VERSION
).
tar.gz newt-
$(VERSION
)
173 @
rm -rf
/tmp
/newt-
$(VERSION
)
174 @cp
/tmp
/newt-
$(VERSION
).
tar.gz .
175 @
rm -f
/tmp
/newt-
$(VERSION
).
tar.gz
177 @echo
"The final archive is ./newt-$(VERSION).tar.gz."
179 tag-archive
: Makefile
182 archive
: tag-archive create-archive
184 ifeq (.depend
,$(wildcard .depend
))