Re: makefile if/then/else
Hi,
>>"Paul" == Paul Haggart <phaggart@debian.org> writes:
Paul> Can someone give me an example of how to do if/then/else in a
Paul> makefile? I followed the example in the make info page, but it
Paul> doesn't seem to work for me.
This is a working example from the kernel-package package.
# The default architecture (all if architecture independent)
architecture:=$(shell dpkg --print-architecture)
ifneq ($(strip $(filter m68k sparc,$(architecture))),)
[...]
kimage := vmlinux
else
kimage := bzImage
endif
[...]
kernel-image kernel_image: stamp-image
stamp-image: configure build
[...]
ifneq ($(strip $(architecture)),m68k)
$(install_file) $(DEBDIR)/LiloDefault \
debian/tmp-image/usr/doc/$(i_package)/LiloDefault
gzip -9f debian/tmp-image/usr/doc/$(i_package)/LiloDefault
endif
[...]
# m68k and sparc have no vmlinuz
ifeq ($(strip $(filter m68k sparc,$(architecture))),)
cp arch/$(architecture)/boot/$(kimage) \
debian/tmp-image/boot/vmlinuz-$(version)
chmod 644 debian/tmp-image/boot/vmlinuz-$(version)
endif
ifeq ($(strip $(architecture)),m68k)
cp vmlinux debian/tmp-image/boot/vmlinux-$(version)
chmod 644 debian/tmp-image/boot/vmlinux-$(version)
endif
ifeq ($(strip $(architecture)),sparc)
elftoaout vmlinux -o debian/tmp-image/boot/vmlinux-$(version)
chmod 644 debian/tmp-image/boot/vmlinux-$(version)
endif
cp System.map debian/tmp-image/boot/System.map-$(version)
manoj
--
Date: 7 Mar 90 05:58:52 GMT From: merlyn@iwarp.intel.com (Randal
Schwartz) $_="kheauroes ,rJttParn lhc e";srand(1);
while($a=length){$a=rand($a);print(substr($_,$a,1));substr($_,$a,1)="";}
Manoj Srivastava <srivasta@acm.org> <http://www.datasync.com/%7Esrivasta/>
Key C7261095 fingerprint = CB D9 F4 12 68 07 E4 05 CC 2D 27 12 1D F5 E8 6E
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: