Prehladnejsi "make"

Martin `MJ' Mares mj na ucw.cz
Středa Březen 26 15:34:27 CET 2008


Dobry den,

> Ale uz jsem u nekolika projektu videl neukecany vystup (prinejmensim
> myslim kernel, ufoai, makefile generovane pomoci cmake), kde bylo jenom
> jmeno souboru a co se s nim provadelo (kompilace, linkovani atd.). Bylo
> to na zaklade normalniho make, takze je to bud nejaka finta v makefile,
> nebo parametr gcc. Takze hura k manualu :-)

finta v Makefile. Da se to zaridit treba takto (vystrizek z makefilu
v libucw):

# Set to 1 if you want verbose output
V=0

# Define M (message) and Q (quiet command prefix) macros
ifeq ($(V),1)
M=@\#
Q=
else
M=@echo #
Q=@
endif

# An example of a compilation rule
%.o: %.c
	$(M)CC $<
	$(Q)$(CC) $(CFLAGS) -c -o $@ $<

				Have a nice fortnight
-- 
Martin `MJ' Mares                          <mj na ucw.cz>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
This sentence contradicts itself -- no actually it doesn't.



Další informace o konferenci Linux