3 SRCS
= $(wildcard *.
cc)
5 INCS
= $(filter-out bsconf.
%,$(wildcard *.h
)) libiff.tbff
7 ################ Library link names ####################################
9 TOCLEAN
+= ${LIBSO} ${LIBA} ${LIBSOBLD}
11 ALLINST
= install-incs
13 ALLLIBS
+= ${LIBSOBLD}
14 ALLINST
+= install-shared
18 ALLINST
+= install-static
21 ################ Compilation ###########################################
23 .PHONY
: all install uninstall install-incs uninstall-incs
24 .PHONY
: install-static install-shared uninstall-static uninstall-shared
25 .PHONY
: clean depend html
dist distclean maintainer-clean
30 @echo
" Compiling $< ..."
31 @
${CXX} ${CXXFLAGS} -o
$@
-c
$<
34 @echo
" Compiling $< to assembly ..."
35 @
${CXX} ${CXXFLAGS} -S
-o
$@
-c
$<
38 @echo
"Linking $@ ..."
43 @echo
"Linking $@ ..."
44 @
${LD} ${LDFLAGS} ${SHBLDFL} -o
$@
$^
${LIBS}
49 ################ Installation ##########################################
52 uninstall: $(subst install,uninstall,${ALLINST})
54 install-shared
: ${LIBSOBLD}
55 @echo
"Installing ${LIBSOBLD} to ${LIBDIR} ..."
56 @
${INSTALLDIR} ${LIBDIR}
57 @
${INSTALLLIB} ${LIBSOBLD} ${LIBDIR}
59 rm -f
${LIBSO} ${LIBSOLNK}; \
60 ln
-sf
${LIBSOBLD} ${LIBSO}; \
61 ln
-sf
${LIBSOBLD} ${LIBSOLNK})
64 @echo
"Removing ${LIBSOBLD} from ${LIBDIR} ..."
66 rm -f
${LIBSO} ${LIBSOLNK} ${LIBSOBLD})
68 install-static
: ${LIBA}
69 @echo
"Installing ${LIBA} to ${LIBDIR} ..."
70 @
${INSTALLDIR} ${LIBDIR}
71 @
${INSTALLLIB} ${LIBA} ${LIBDIR}
74 @echo
"Removing ${LIBA} from ${LIBDIR} ..."
75 @
rm -f
${LIBDIR}/${LIBA}
78 @echo
"Installing headers to ${INCDIR} ..."
79 @
${INSTALLDIR} ${INCDIR}/${LIBNAME}
80 @for i in
$(filter-out ${LIBNAME}.h
,${INCS}); do \
81 ${INSTALLDATA} $$i ${INCDIR}/${LIBNAME}/$$i; \
83 @
${INSTALLDATA} ${LIBNAME}.h
${INCDIR}
86 @echo
"Removing headers from ${INCDIR} ..."
87 @
rm -rf
${INCDIR}/${LIBNAME} ${INCDIR}/${LIBNAME}.h
89 ################ Maintenance ###########################################
92 @echo
"Removing generated files ..."
93 @
rm -f
${OBJS} ${TOCLEAN}
96 @
${CXX} ${CXXFLAGS} -M
${SRCS} > .depend
;
99 DISTDIR
= ${HOME}/stored
101 DISTVER
= ${MAJOR}.
${MINOR}
103 DISTVER
= ${MAJOR}.
${MINOR}.
${BUILD}
105 DISTNAM
= ${LIBNAME}-${DISTVER}
106 DISTLSM
= ${DISTNAM}.lsm
107 DISTTAR
= ${DISTNAM}.
tar.bz2
108 DDOCTAR
= ${DISTNAM}-docs.
tar.bz2
111 mkdir
${TMPDIR}/${DISTNAM}
112 cp
-r .
${TMPDIR}/${DISTNAM}
113 +${MAKE} -C
${TMPDIR}/${DISTNAM} distclean
114 (cd
${TMPDIR}/${DISTNAM}; rm -rf docs
/html .git
)
115 (cd
${TMPDIR}; tar jcf
${DISTDIR}/${DISTTAR} ${DISTNAM}; rm -rf
${DISTNAM})
118 @
rm -f Config.mk config.h bsconf.o bsconf .depend
120 maintainer-clean
: distclean