1 | |
---|
2 | bindir = @bindir@ |
---|
3 | datadir = @datadir@ |
---|
4 | datarootdir = @datarootdir@ |
---|
5 | exec_prefix = @exec_prefix@ |
---|
6 | includedir = @includedir@ |
---|
7 | libdir = @libdir@ |
---|
8 | mandir = @mandir@ |
---|
9 | prefix = @prefix@ |
---|
10 | srcdir = @srcdir@ |
---|
11 | |
---|
12 | CC = $(CXX) |
---|
13 | CCC = @CC@ |
---|
14 | CFLAGS_DEBUG = @CFLAGS_DEBUG@ -Wall |
---|
15 | CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ |
---|
16 | STLIB_LD = @STLIB_LD@ |
---|
17 | SHLIB_LD = @SHLIB_LD@ |
---|
18 | SHLIB_CFLAGS = @SHLIB_CFLAGS@ |
---|
19 | SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ |
---|
20 | SHLIB_SUFFIX = @SHLIB_SUFFIX@ |
---|
21 | CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ |
---|
22 | LIB_SEARCH_DIRS = @LIB_SEARCH_DIRS@ |
---|
23 | CFLAGS = @CFLAGS@ -fPIC |
---|
24 | |
---|
25 | AR = ar |
---|
26 | INSTALL = @INSTALL@ |
---|
27 | MKDIR_P = @MKDIR_P@ |
---|
28 | RANLIB = @RANLIB@ |
---|
29 | RM = rm -f |
---|
30 | VPATH = $(srcdir) |
---|
31 | |
---|
32 | CDEBUGFLAGS = -g -Wall |
---|
33 | |
---|
34 | PERL = @PERL@ |
---|
35 | PERL_ARCHLIB = @PERL_ARCHLIB@ |
---|
36 | PERL_VERSION = @PERL_VERSION@ |
---|
37 | PERL_VERSION_RV = @PERL_VERSION_RV@ |
---|
38 | PERL_LIBSPEC = @PERL_LIBSPEC@ |
---|
39 | MAN3EXT = .3pm |
---|
40 | perl5dir = $$RAPPTURE_INSTALL_DIR/lib/perl/$(PERL_VERSION_RV) |
---|
41 | includes = @PERL_INCLUDES@ |
---|
42 | ccflags = @PERL_CCFLAGS@ |
---|
43 | cppflags = @PERL_CPPFLAGS@ |
---|
44 | vendorlib = @PERL_VENDORLIB@ |
---|
45 | privlib = @PERL_PRIVLIB@ |
---|
46 | archlib = @PERL_ARCHLIB@ |
---|
47 | archlibexp = @PERL_ARCHLIBEXP@ |
---|
48 | XSUBPP = @XSUBPP@ |
---|
49 | |
---|
50 | name = Rappture |
---|
51 | lib = $(name)$(SHLIB_SUFFIX) |
---|
52 | man = $(name)$(MAN3EXT) |
---|
53 | bootstrap = $(name).bs |
---|
54 | pod = perllocal.pod |
---|
55 | |
---|
56 | destdir = $(libdir)/perl |
---|
57 | |
---|
58 | CXX_SWITCHES = $(CFLAGS) $(cppflags) $(CFLAGS_DEBUG) $(INCLUDES) $(DEFINES) |
---|
59 | |
---|
60 | INCLUDES = \ |
---|
61 | -I$(srcdir) \ |
---|
62 | -I$(srcdir)/../../src/core \ |
---|
63 | -I$(archlibexp)/CORE |
---|
64 | |
---|
65 | LIBS = \ |
---|
66 | -L../../src/core -lrappture \ |
---|
67 | $(PERL_LIBSPEC) \ |
---|
68 | -lexpat |
---|
69 | |
---|
70 | all: $(lib) $(bootstrap) $(man) $(pod) |
---|
71 | |
---|
72 | Rappture.cc: $(srcdir)/Rappture.xs |
---|
73 | $(XSUBPP) -C++ -typemap $(privlib)/ExtUtils/typemap -typemap typemap \ |
---|
74 | $? > $@ |
---|
75 | |
---|
76 | Rappture.o: Rappture.cc |
---|
77 | $(CXX) -c $(CXX_SWITCHES) $? |
---|
78 | |
---|
79 | $(bootstrap): |
---|
80 | $(PERL) "-MExtUtils::Mkbootstrap" \ |
---|
81 | -e "Mkbootstrap('Rappture','rappture');" |
---|
82 | |
---|
83 | $(lib): Rappture.o |
---|
84 | $(SHLIB_LD) $(SHLIB_CFLAGS) -o $@ $< $(LIB_SEARCH_DIRS) $(LIBS) |
---|
85 | |
---|
86 | $(man): $(srcdir)/lib/Rappture.pm |
---|
87 | $(PERL) "-MExtUtils::Command::MM" -e "pod2man" -- \ |
---|
88 | --section=3 --perm_rw=444 $? $@ |
---|
89 | $(pod): |
---|
90 | $(PERL) "-MExtUtils::Command::MM" -e perllocal_install \ |
---|
91 | "Module" "Rappture" \ |
---|
92 | "installed into" "$(destdir)" \ |
---|
93 | LINKTYPE "dynamic" \ |
---|
94 | VERSION "0.01" \ |
---|
95 | EXE_FILES "" >> $@ |
---|
96 | |
---|
97 | install: $(lib) $(bootstrap) $(man) $(pod) |
---|
98 | $(MKDIR_P) -m 0755 $(destdir) |
---|
99 | $(INSTALL) -m 0555 $(lib) $(destdir) |
---|
100 | $(INSTALL) -m 0444 $(srcdir)/lib/Rappture.pm $(destdir) |
---|
101 | $(INSTALL) -m 0444 $(bootstrap) $(destdir) |
---|
102 | $(INSTALL) -m 0444 $(man) $(destdir) |
---|
103 | $(INSTALL) -m 0444 $(pod) $(destdir) |
---|
104 | |
---|
105 | clean: |
---|
106 | $(RM) $(lib) $(bootstrap) $(man) $(pod) Rappture.o Rappture.cc |
---|
107 | $(RM) -r $(pkg_build_dir) |
---|
108 | |
---|
109 | distclean: clean |
---|
110 | |
---|
111 | # Package build procedure |
---|
112 | |
---|
113 | pkg_build_dir = build |
---|
114 | |
---|
115 | pkg: pkgtmp |
---|
116 | $(MAKE) -C $(pkg_build_dir) |
---|
117 | |
---|
118 | pkgtmp: |
---|
119 | $(RM) -r $(pkg_build_dir) |
---|
120 | $(MKDIR_P) -m 0755 $(pkg_build_dir) |
---|
121 | cp -p Makefile.PL $(pkg_build_dir)/Makefile.PL |
---|
122 | tar -C $(srcdir) -clf - . | tar -C $(pkg_build_dir) -xpf - |
---|
123 | (cd $(pkg_build_dir); $(PERL) Makefile.PL) |
---|
124 | |
---|
125 | pkginstall: |
---|
126 | $(MAKE) -C $(pkg_build_dir) install_perl |
---|
127 | |
---|
128 | pkgclean: |
---|
129 | $(MAKE) -C $(pkg_build_dir) clean |
---|
130 | $(RM) -rf $(pkg_build_dir) |
---|