1 # /**********************************************************
2 # SixXS - Automatic IPv6 Connectivity Configuration Utility
3 # ***********************************************************
4 # Copyright 2003-2005 SixXS - http://www.sixxs.net
5 # ***********************************************************
7 # ***********************************************************
9 # $Id: Makefile,v 1.22 2007-01-11 00:29:33 jeroen Exp $
10 # $Date: 2007-01-11 00:29:33 $
11 # **********************************************************/
13 # Note for BSD people: use GNU Make (gmake)
16 PROJECT_DESC
="Automatic IPv6 Connectivity Configuration Utility"
17 PROJECT_VERSION
=$(shell grep
"AICCU_VER" common
/aiccu.h | head
-n
1 | awk
'{print $$3}' | tr
-d
\")
23 RPMBUILD
=@echo
[RPMBUILD
]; rpmbuild
24 RPMBUILD_SILENCE
=>/dev
/null
2>/dev
/null
26 # Excludes for limited source release
27 EXCLUDES
=--exclude
"${PROJECT}/windows-*" --exclude
"${PROJECT}/common/aiccu_win32.c" --exclude CVS
--exclude
"${PROJECT}/common/tsp*" --exclude
"${PROJECT}/common/teepee*"
28 DEBEXCL
=-Iwindows-
* -Icommon
/aiccu_win32.c
-I
*CVS
* -Icommon
/tsp
* -Icommon
/teepee
*
30 # Change this if you want to install into another dirtree
31 # Required for eg the Debian Package builder
35 # This may be updated by RPM's for instance
36 CFLAGS
=${RPM_OPT_FLAGS}
38 # Destination Paths (relative to DESTDIR)
42 dirdoc
=/usr
/share
/doc
/${PROJECT}/
44 # Make sure the lower makefile also knows these
47 export PROJECT_VERSION
48 export PROJECT_COPYRIGHT
66 all: Makefile unix-console
/
67 @echo
"Building : $(PROJECT) - $(PROJECT_DESC)"
68 @echo
"Copyright : SixXS"
69 @echo
"Version : $(PROJECT_VERSION)"
70 $(MAKE
) -C unix-console
all
74 @echo
"Installing into ${DESTDIR}..."
76 @mkdir
-p
${DESTDIR}${dirsbin}
77 $(MAKE
) -C unix-console
install
78 @mkdir
-p
${DESTDIR}${dirdoc}
79 @echo
"Configuration..."
80 @mkdir
-p
${DESTDIR}${diretc}
81 ifeq ($(shell echo
"A${RPM_BUILD_ROOT}"),A
)
82 $(shell [ -f
${DESTDIR}${diretc}${PROJECT}.conf
] || cp
-R doc
/${PROJECT}.conf
${DESTDIR}${diretc}${PROJECT}.conf
)
83 @echo
"Documentation..."
84 @cp doc
/README
${DESTDIR}${dirdoc}
85 @cp doc
/LICENSE
${DESTDIR}${dirdoc}
86 @cp doc
/HOWTO
${DESTDIR}${dirdoc}
87 @echo
"Installing Debian-style init.d"
88 @mkdir
-p
${DESTDIR}${diretc}init.d
89 @cp doc
/${PROJECT}.init.debian
${DESTDIR}${diretc}init.d
/${PROJECT}
91 @echo
"Installing Redhat-style init.d"
92 @mkdir
-p
${DESTDIR}${diretc}init.d
93 @cp doc
/${PROJECT}.init.rpm
${DESTDIR}${diretc}init.d
/${PROJECT}
94 @cp doc
/${PROJECT}.conf
${DESTDIR}${diretc}${PROJECT}.conf
96 @echo
"Installation into ${DESTDIR}/ completed"
99 @echo
"$(PROJECT) - $(PROJECT_DESC)"
101 @echo
"Makefile targets:"
102 @echo
"all : Build everything"
103 @echo
"help : This little text"
104 @echo
"install : Build & Install into ${DESTDIR}/"
105 @echo
"clean : Clean the dirs to be pristine in bondage"
107 @echo
"Distribution targets:"
108 @echo
"dist : Make all distribution targets (except rpm's)"
109 @echo
"tar : Make source tarball (tar.gz)"
110 @echo
"bz2 : Make source tarball (tar.bz2)"
111 @echo
"deb : Make Debian binary package (.deb)"
112 @echo
"debsrc : Make Debian source packages"
113 @echo
"rpm : Make RPM package (.rpm)"
114 @echo
"rpmsrc : Make RPM source packages"
116 @echo
"SixXS targets:"
117 @echo
"tarfull : Full tar including Windows directories"
118 @echo
"bz2full : Full bz2 including Windows directories"
120 aiccu
: doc unix-console
/
121 $(MAKE
) -C unix-console
all
125 doc
/aiccu
.1: doc
/aiccu.sgml
126 docbook-to-man doc
/aiccu.sgml
>doc
/aiccu
.1
128 clean: debclean rpmclean
129 $(MAKE
) -C unix-console
clean
130 -${RM} -r windows-gui
/Debug
131 -${RM} -r windows-gui
/Release
132 -${RM} windows-gui
/AICCU.APS
133 -${RM} windows-gui
/AICCU.ncb
134 -${RM} -r windows-console
/Debug
135 -${RM} -r windows-console
/Release
136 -${RM} windows-console
/AICCU.APS
137 -${RM} windows-console
/AICCU.ncb
139 # Generate Distribution files
144 -${RM} ..
/${PROJECT}_
${PROJECT_VERSION}.
tar.gz
145 tar -zco
-C ..
${EXCLUDES} -f ..
/${PROJECT}_
${PROJECT_VERSION}.
tar.gz
${PROJECT}
149 -${RM} ..
/${PROJECT}_
${PROJECT_VERSION}.
tar.gz
150 tar -zco
-C ..
-f ..
/${PROJECT}_
${PROJECT_VERSION}-full.
tar.gz
${PROJECT}
154 -${RM} ..
/${PROJECT}_
${PROJECT_VERSION}.
tar.bz2
155 tar -jco
-C ..
${EXCLUDES} -f ..
/${PROJECT}_
${PROJECT_VERSION}.
tar.bz2
${PROJECT}
159 -${RM} ..
/${PROJECT}_
${PROJECT_VERSION}.
tar.bz2
160 tar -jco
-C ..
-f ..
/${PROJECT}_
${PROJECT_VERSION}-full.
tar.bz2
${PROJECT}
165 ${CP} doc
/changelog debian
/changelog
166 ${CP} doc
/${PROJECT}.init.debian debian
/${PROJECT}.init
167 dpkg-buildpackage
$(DEBEXCL
) -rfakeroot
170 # Cleanup after debian
172 -${RM} debian
/${PROJECT}.init debian
/${PROJECT}.conffiles
173 if
[ -f build-stamp
]; then debian
/rules
clean; fi
177 -${RM} /usr
/src
/redhat
/RPMS
/i386
/${PROJECT}-*.rpm
178 ${RPMBUILD} -tb
--define '${PROJECT}_version ${PROJECT_VERSION}' ..
/${PROJECT}_
${PROJECT_VERSION}.
tar.gz
${RPMBUILD_SILENCE}
179 @if
[ -d
/usr
/src
/redhat
/RPMS
/i386
/ ]; then mv
/usr
/src
/redhat
/RPMS
/i386
/${PROJECT}-*.rpm ..
/; fi
180 @if
[ -d
/usr
/src
/rpm
/RPMS
/i386
/ ]; then mv
/usr
/src
/rpm
/RPMS
/i386
/${PROJECT}-*.rpm ..
/; fi
181 @echo
"Resulting RPM's:"
182 @ls
-l ..
/${PROJECT}-*.rpm
184 @echo
"RPMBuild done"
187 -${RM} /usr
/src
/redhat
/RPMS
/i386
/${PROJECT}-*src.rpm
188 ${RPMBUILD} -ts
--define '${PROJECT}_version ${PROJECT_VERSION}' ..
/${PROJECT}_
${PROJECT_VERSION}.
tar.gz
${RPMBUILD_SILENCE}
189 @if
[ -d
/usr
/src
/redhat
/RPMS
/i386
/ ]; then mv
/usr
/src
/redhat
/RPMS
/i386
/${PROJECT}-*.src.rpm ..
/; fi
190 @if
[ -d
/usr
/src
/rpm
/RPMS
/i386
/ ]; then mv
/usr
/src
/rpm
/RPMS
/i386
/${PROJECT}-*.src.rpm ..
/; fi
191 @echo
"Resulting RPM's:"
192 @ls
-l ..
/${PROJECT}-*.rpm
194 @echo
"RPMBuild-src done"
197 -${RM} ..
/${PROJECT}_
${PROJECT_VERSION}.
tar.gz
199 # Mark targets as phony
200 .PHONY
: all install help
clean dist tar bz2 deb debclean rpm rpmsrc