Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 170383 - sys-devel/make-3.81: a "%.cpp" rule is not working
Summary: sys-devel/make-3.81: a "%.cpp" rule is not working
Status: VERIFIED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-11 09:47 UTC by Anton Kuzmin
Modified: 2007-03-11 14:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Makefile (Makefile,183 bytes, text/plain)
2007-03-11 09:47 UTC, Anton Kuzmin
Details
helloworld.cpp (helloworld.cpp,115 bytes, text/plain)
2007-03-11 09:48 UTC, Anton Kuzmin
Details
A tar.bz2 archive with all the files (02-makefile.tar.bz2,403 bytes, application/octet-stream)
2007-03-11 12:16 UTC, Anton Kuzmin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Kuzmin 2007-03-11 09:47:15 UTC
I cannot build a simple helloworld.cpp file using one of the make rules.

Taken from '$ make -p':
%.cpp:
%: %.cpp
#  commands to execute (built-in):
        $(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@

===============================================
$ make
make: Nothing to be done for `all'.
$ touch helloworld.cpp
$ make
make: Nothing to be done for `all'.
$ echo "changes" >> helloworld.cpp
$ make
make: Nothing to be done for `all'. 
===============================================

And helloworld doesn't even exist (has never been built).

sys-devel/make-3.81

Portage 2.1.2.2 (default-linux/amd64/2006.1, gcc-4.1.2, glibc-2.4-r4, 2.6.20-gentoo x86_64)
=================================================================
System uname: 2.6.20-gentoo x86_64 AMD Turion(tm) 64 Mobile Technology MT-32
Gentoo Base System release 1.12.9
Timestamp of tree: Fri, 09 Mar 2007 09:00:02 +0000
dev-java/java-config: 1.3.7, 2.0.31-r4
dev-lang/python:     2.4.3-r4, 2.4.4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17, 1.2.18.1
sys-devel/autoconf:  2.13, 2.60, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3, 2.17
sys-devel/gcc-config: 1.3.13-r4, 1.3.14
sys-devel/libtool:   1.5.22, 1.5.23b
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=athlon64 -msse3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/php/apache1-php5/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=athlon64 -msse3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acpi alsa amd64 apache2 audiofile bitmap-fonts blender-game bluetooth bzip2 cairo cdr cli contentcache cracklib crypt dbus disassembler djvu dvb dvd dvdr dvdread dvi encode examples fat ffmpeg firefox flac fuse gd gdbm gif glibc-omitfp glitz gnome gpm gstreamer gtk hal howl iconv imagemagick immqt isdnlog java java5 javascript jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility libg++ libnotify mad midi mikmod mjpeg mng mp3 mpeg mplayer music musicbrainz mysql nautilus ncurses nforce2 nls nptl nptlonly nsplugin ntfs nvidia ogg opengl pam pcre pdf pdo php plotutils pmu png postgres ppds pppd python qt3 quicktime readline reflection reiserfs ruby samba sdl session sharedmem sndfile socks5 spell spl sqlite ssl subtitles svg tagwriting tcpd theora tidy truetype truetype-fonts type1-fonts unicode urandom usb vcd vorbis xforms xfs xine xml xorg xv xvid zip zlib" ALSA_CARDS="snd-intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nv nvidia vesa vmware"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Anton Kuzmin 2007-03-11 09:47:50 UTC
Created attachment 112913 [details]
Makefile
Comment 2 Anton Kuzmin 2007-03-11 09:48:07 UTC
Created attachment 112914 [details]
helloworld.cpp
Comment 3 Anton Kuzmin 2007-03-11 09:49:59 UTC
The object file is built though editing the Makefile a bit:
$(OUTPUTFILE): helloworld.o
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-03-11 09:58:57 UTC
(In reply to comment #3)
> The object file is built though editing the Makefile a bit:
> $(OUTPUTFILE): helloworld.o

Yeah; also note that this is not a support forum for writing your code.
Comment 5 Anton Kuzmin 2007-03-11 12:15:22 UTC
What can I do to find the root of the problem? WORKSFORME shouldn't mean that the bug is resolved.

Shoot me but it doesn't work on my other two PCs, too.

Please try again to reproduce my problem. I will attach a tar.bz2 archive.
Comment 6 Anton Kuzmin 2007-03-11 12:16:18 UTC
Created attachment 112921 [details]
A tar.bz2 archive with all the files
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2007-03-11 12:20:53 UTC
(In reply to comment #5)
> What can I do to find the root of the problem? WORKSFORME shouldn't mean that
> the bug is resolved.

Maybe re-read what you've yourself written in Comment #3? Plus stop using bugzilla as 'hello-world-writing-support'.
Comment 8 Anton Kuzmin 2007-03-11 12:25:49 UTC
$(OUTPUTFILE): helloworld.cpp
should work (build an ELF binary file helloworld) but it doesn't work - that's the problem...

I am confused.
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2007-03-11 12:47:21 UTC
Sigh...

--- Makefile.orig	2007-03-11 12:59:33.000000000 +0100
+++ Makefile	2007-03-11 13:45:34.000000000 +0100
@@ -1,9 +1,10 @@
 OUTPUTFILE=helloworld
 INSTALLDIR=bin
 
+$(OUTPUTFILE): helloworld.cpp
+
 all: $(OUTPUTFILE)
 
-$(OUTPUTFILE): helloworld.cpp
 	
 .PHONY: install
 install:
Comment 10 Anton Kuzmin 2007-03-11 13:23:51 UTC
Thanks, Jakub! It worked. I still don't understand why all target should be below.
Comment 11 Anton Kuzmin 2007-03-11 14:05:19 UTC
The problem was with the two spurious \t

<arbscht> remove the spurious \t's beneath $(OUTPUTFILE): helloworld.cpp and cp -p hello bin/

Close the bug if it is an intended behavior.
Comment 12 Jakub Moc (RETIRED) gentoo-dev 2007-03-11 14:07:51 UTC
Please, last time - this is NOT a support forum for fixing your broken Makefiles... 

CLOSED.