projtec:make
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
projtec:make [2020/09/15 20:29] – orel | projtec:make [2024/03/18 15:06] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 96: | Line 96: | ||
Plus d'info sur les régles implicites : https:// | Plus d'info sur les régles implicites : https:// | ||
+ | |||
+ | ==== Pour aller un peu plus loin ==== | ||
L' | L' | ||
Line 112: | Line 114: | ||
CC=gcc | CC=gcc | ||
CFLAGS=-Wall -g -std=c99 | CFLAGS=-Wall -g -std=c99 | ||
- | LDFLAGS=-lm # options de link | + | LDFLAGS= |
+ | LDLIBS=-lm | ||
CPPFLAGS= | CPPFLAGS= | ||
Line 120: | Line 123: | ||
# règle spécifique pour générer l' | # règle spécifique pour générer l' | ||
toto: toto.o tutu.o tata.o | toto: toto.o tutu.o tata.o | ||
- | $(CC) $^ -o $@ $(LDFLAGS) | + | |
.PHONY: clean dep | .PHONY: clean dep | ||
Line 137: | Line 140: | ||
Dans ce cas, il faut commencer par faire "make dep" pour générer le fichier des dépendances, | Dans ce cas, il faut commencer par faire "make dep" pour générer le fichier des dépendances, | ||
- | ==== Pour aller un peu plus loin ==== | + | ==== Pour aller encore |
//Parler de Makefile recursif avec "make -C subdir" | //Parler de Makefile recursif avec "make -C subdir" | ||
Line 145: | Line 148: | ||
SOURCES | SOURCES | ||
INCLUDES := $(wildcard *.h) | INCLUDES := $(wildcard *.h) | ||
- | OBJECTS | + | OBJECTS |
</ | </ | ||
+ | |||
+ | ==== Nota Bene ==== | ||
+ | |||
+ | //Quelques astuces...// | ||
+ | |||
+ | * @ suppresses the normal ' | ||
+ | * - means ignore the exit status of the command that is executed (normally, a non-zero exit status would stop that part of the build). | ||
+ | * + means ' | ||
+ | |||
+ | Plus d'info : https:// | ||
projtec/make.1600201786.txt.gz · Last modified: 2024/03/18 15:05 (external edit)