~ubuntu-branches/ubuntu/utopic/newt/utopic

« back to all changes in this revision

Viewing changes to .pc/snackmodule.patch/Makefile.in

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-07-01 23:06:29 UTC
  • mfrom: (2.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20130701230629-vn7p5llzt03j09mv
Tags: 0.52.15-2ubuntu1
* Merge with Debian; remaining changes:
  - Fix python-* package descriptions.
  - Install/remove alternatives for the ubuntu palette.
  - Don't install python-newt example files.
  - Install whiptail in /bin instead of /usr/bin.
* Still build with tcl8.5 (8.6 is in universe).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
LIBS = -lslang @LIBS@
 
2
LIBTCL = @TCL_LIB_FLAG@
 
3
 
 
4
CC = @CC@
 
5
CPP = @CPP@
 
6
CFLAGS = @CFLAGS@
 
7
LDFLAGS = @LDFLAGS@
 
8
CPPFLAGS = -D_GNU_SOURCE -I/usr/include/slang @CPPFLAGS@ 
 
9
GNU_LD = @GNU_LD@
 
10
 
 
11
VERSION = @VERSION@
 
12
TAG = r$(subst .,-,$(VERSION))
 
13
SONAME = @SONAME@
 
14
 
 
15
PYTHONVERS =  $(shell pyversions --supported; py3versions --supported)
 
16
WHIPTCLSO = @WHIPTCLSO@
 
17
 
 
18
PROGS = test whiptail $(WHIPTCLSO) testgrid testtree showchars showkey
 
19
TESTOBJS = test.o testgrid.o testtree.o showchars.o showkey.o
 
20
NDIALOGOBJS = whiptail.o dialogboxes.o
 
21
WHIPTCLOBJS = shared/whiptcl.o shared/dialogboxes.o
 
22
LIBNEWT = libnewt.a
 
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 \
 
27
          checkboxtree.o
 
28
 
 
29
ifneq ($(GNU_LD),)
 
30
SHLIBFLAGS= -Wl,--version-script,newt.0.52.ver -Wl,-soname,$(LIBNEWTSONAME)
 
31
else
 
32
SHLIBFLAGS=
 
33
endif
 
34
 
 
35
SHCFLAGS = -fPIC
 
36
 
 
37
prefix = @prefix@
 
38
includedir = @includedir@
 
39
exec_prefix = @exec_prefix@
 
40
libdir = @libdir@
 
41
bindir = @bindir@
 
42
datadir = @datadir@
 
43
datarootdir = @datarootdir@
 
44
mandir = @mandir@
 
45
man1dir = $(mandir)/man1
 
46
pkgconfigdir = $(libdir)/pkgconfig
 
47
instroot ?= $(DESTDIR)
 
48
 
 
49
#--------------------------------------
 
50
 
 
51
SOURCES = $(subst .o,.c,$(TESTOBJS) $(NDIALOGOBJS) $(LIBOBJS))
 
52
 
 
53
SHAREDDIR = shared
 
54
SHAREDOBJS = $(patsubst %,$(SHAREDDIR)/%, $(LIBOBJS))
 
55
 
 
56
ifeq (.depend,$(wildcard .depend))
 
57
TARGET=$(PROGS)
 
58
else
 
59
TARGET=depend $(PROGS)
 
60
endif
 
61
 
 
62
all:    $(TARGET) _snackmodule.so whiptcl.so
 
63
 
 
64
test:   test.o $(LIBNEWT)
 
65
        $(CC) -g -o test test.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
 
66
 
 
67
testgrid:       testgrid.o $(LIBNEWT)
 
68
        $(CC) -g -o testgrid testgrid.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
 
69
 
 
70
testtree:       testtree.o $(LIBNEWT)
 
71
        $(CC) -g -o testtree testtree.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
 
72
 
 
73
showchars:      showchars.o $(LIBNEWT)
 
74
        $(CC) -g -o showchars showchars.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
 
75
 
 
76
showkey:        showkey.o $(LIBNEWT)
 
77
        $(CC) -g -o showkey showkey.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
 
78
 
 
79
_snackmodule.so:   snackmodule.c $(LIBNEWTSH)
 
80
        @[ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS); do \
 
81
                pyconfig=$$ver-config; \
 
82
                if ! $$pyconfig --cflags > /dev/null 2>&1 && \
 
83
                                python-config --cflags > /dev/null 2>&1; then \
 
84
                        echo $$pyconfig not found, using python-config; \
 
85
                        pyconfig=python-config; \
 
86
                fi; \
 
87
                mkdir -p $$ver; \
 
88
                PCFLAGS=`$$pyconfig --cflags`; \
 
89
                PIFLAGS=`$$pyconfig --includes`; \
 
90
                PLDFLAGS=`$$pyconfig --ldflags`; \
 
91
                PLFLAGS=`$$pyconfig --libs`; \
 
92
                echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \
 
93
                $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o $$ver/snackmodule.o snackmodule.c; \
 
94
                echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L.  -lnewt $(LIBS); \
 
95
                $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L.  -lnewt $(LIBS); \
 
96
        done || :
 
97
        touch $@
 
98
 
 
99
whiptail: $(NDIALOGOBJS) $(LIBNEWTSH)
 
100
        $(CC) -g -o whiptail $(NDIALOGOBJS) -L. $(LDFLAGS) -lnewt $(LIBS) -lpopt
 
101
 
 
102
whiptcl.so: $(WHIPTCLOBJS) $(LIBNEWTSH)
 
103
        $(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.so $(WHIPTCLOBJS) -L. -lnewt  $(LIBTCL) -lpopt $(LIBS)
 
104
 
 
105
$(LIBNEWT): $(LIBOBJS)
 
106
        ar rv $@ $^
 
107
 
 
108
newt.o $(SHAREDDIR)/newt.o: newt.c Makefile
 
109
 
 
110
veryclean: clean
 
111
        rm -f .depend *.pc
 
112
 
 
113
clean:
 
114
        rm -f $(PROGS) *.o $(LIBNEWT) core $(LIBNEWTSH)  \
 
115
                $(SHAREDDIR)/*.o *.so*
 
116
 
 
117
depend:
 
118
        $(CPP) $(CFLAGS) $(CPPFLAGS) -M $(SOURCES) > .depend
 
119
 
 
120
$(SHAREDDIR):
 
121
        mkdir -p $(SHAREDDIR)
 
122
 
 
123
sharedlib: $(LIBNEWTSH)
 
124
 
 
125
$(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS)
 
126
        $(CC) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) $(SHAREDOBJS) $(LDFLAGS) $(LIBS)
 
127
        ln -fs $(LIBNEWTSONAME) libnewt.so
 
128
        ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME)
 
129
 
 
130
$(SHAREDDIR)/%.o : %.c
 
131
        $(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
 
132
 
 
133
install: $(LIBNEWT) install-sh whiptail
 
134
        [ -d $(instroot)/$(bindir) ] || install -m 755 -d $(instroot)/$(bindir)
 
135
        [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir)
 
136
        [ -d $(instroot)/$(includedir) ] || install -m 755 -d $(instroot)/$(includedir)
 
137
        [ -d $(instroot)/$(man1dir) ] || install -m 755 -d $(instroot)/$(man1dir)
 
138
        [ -d $(instroot)/$(pkgconfigdir) ] || install -m 755 -d $(instroot)/$(pkgconfigdir)
 
139
        install -m 644 newt.h $(instroot)/$(includedir)
 
140
        install -m 644 $(LIBNEWT) $(instroot)/$(libdir)
 
141
        install -m 755 whiptail $(instroot)/$(bindir)
 
142
        install -m 644 whiptail.1 $(instroot)/$(man1dir)
 
143
        make -C po datadir=$(instroot)/$(datadir) install
 
144
        install -m 644 libnewt.pc $(instroot)/$(pkgconfigdir)
 
145
 
 
146
install-sh: sharedlib $(WHIPTCLSO) _snackmodule.so
 
147
        [ -d $(instroot)/$(libdir) ] || install -m 755 -d $(instroot)/$(libdir)
 
148
        install -m 755 $(LIBNEWTSH) $(instroot)/$(libdir)
 
149
        ln -sf $(LIBNEWTSONAME) $(instroot)/$(libdir)/libnewt.so
 
150
        ln -sf $(LIBNEWTSH) $(instroot)/$(libdir)/$(LIBNEWTSONAME)
 
151
        [ -n "$(WHIPTCLSO)" ] && install -m 755 whiptcl.so $(instroot)/$(libdir) || :
 
152
        [ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) ; do \
 
153
           [ -d $(instroot)/$(libdir)/$$ver/site-packages ] || install -m 755 -d $(instroot)/$(libdir)/$$ver/site-packages ;\
 
154
           install -m 755 $$ver/_snackmodule.so $(instroot)/$(libdir)/$$ver/site-packages ;\
 
155
           install -m 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\
 
156
        done || :
 
157
 
 
158
Makefile: newt.spec
 
159
        echo "You need to rerun ./configure before continuing"
 
160
        @exit 1
 
161
 
 
162
create-archive: Makefile
 
163
        @rm -rf /tmp/newt-$(VERSION)
 
164
        @git archive --prefix=newt-$(VERSION)/ $(TAG) | tar x -C /tmp
 
165
        @cd /tmp/newt-$(VERSION) && ./autogen.sh && rm -rf autom4te.cache .tx
 
166
        @cd /tmp; tar czSpf newt-$(VERSION).tar.gz newt-$(VERSION)
 
167
        @rm -rf /tmp/newt-$(VERSION)
 
168
        @cp /tmp/newt-$(VERSION).tar.gz .
 
169
        @rm -f /tmp/newt-$(VERSION).tar.gz
 
170
        @echo " "
 
171
        @echo "The final archive is ./newt-$(VERSION).tar.gz."
 
172
 
 
173
tag-archive: Makefile
 
174
        @git tag $(TAG)
 
175
 
 
176
archive: tag-archive create-archive
 
177
 
 
178
ifeq (.depend,$(wildcard .depend))
 
179
include .depend
 
180
endif