pre fanusikov make

Radovan Augustin rado_augustin na yahoo.com
Čtvrtek Květen 9 17:12:30 CEST 2013


Dobry den,

vas Makefile je v poradku.
make obsahuje implicit rule:
    { "%", "s.%",

"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" }
vid make -p


reseni je v Makefile pouzit target .PHONY:

.PHONY: bin
nebo spoustet make s prepinacem -r

make -r

taky jine suffixy nez '.bin' by nefungovali, napr '.asdf'

Radovan Augustin


________________________________
 From: Jan Waclawek <konfera na efton.sk>
To: HW-news <hw-list na list.hw.cz> 
Sent: Thursday, May 9, 2013 2:26 PM
Subject: pre fanusikov make
 

Co je zle na tomto makefile? Tabulatory su tam, kde treba. Preco nestaci
napisat "make", a musim napisat "make s.bin" aby mi to vyrobilo ten s.bin?
Ak do TARGET dam nieco ine, napr. "TARGET=t", tak "make" vytvori bez reci
t.bin.

(Podotykam, ze som to sam nedokazal vyriesit, musel mi napovedat kolega).

wek



-----

TARGET=s

all: bin

bin: $(TARGET).bin

%.bin : 
    @echo "Making $@"
    @echo $@ > $@

-----

c:\wek\SMO\tmp\tmp>make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-pc-mingw32

c:\wek\SMO\tmp\tmp>cat makefile
TARGET=s

all: bin

bin: $(TARGET).bin

%.bin :
        @echo "Making $@"
        @echo $@ > $@


c:\wek\SMO\tmp\tmp>make
make: *** No rule to make target `s.bin', needed by `bin'.  Stop.

c:\wek\SMO\tmp\tmp>make s.bin
Making s.bin

c:\wek\SMO\tmp\tmp>


_______________________________________________
HW-list mailing list  -  sponsored by www.HW.cz
Hw-list na list.hw.cz
http://list.hw.cz/mailman/listinfo/hw-list
------------- dal?í ?ást ---------------
HTML p?íloha byla odstran?na...
URL: <http://list.hw.cz/pipermail/hw-list/attachments/20130509/a931d802/attachment.htm>


Další informace o konferenci Hw-list