summaryrefslogtreecommitdiff
path: root/Makefile
blob: d49717f51b00b832a30fbee501ff67dc4a2059eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
BIN=ddhardrescue
CFLAGS=-Iinc -Wall -Werror -Wfatal-errors -g -pg
LIBS=-lpanel -lncurses -lpthread

#FIXME : liste des dépendances = tous les .c trouvés. C'est nul.

all: $(BIN)
$(BIN): bin/$(BIN)

bin/$(BIN): obj/$(BIN).o $(patsubst src/%.c,obj/%.o,$(wildcard src/*.c))
	gcc -o $@ $^ $(CFLAGS) $(LIBS)

obj/%.o:
	gcc -c -o $@ $< $(CFLAGS)

deps/%.d: src/%.c
	gcc -o $@ $< $(CFLAGS) -MM -MG -MT $(patsubst src/%.c,obj/%.o,$<) 

Makefile src/%.c inc/%.h: ;

.PHONY: clean

clean:
	-rm -f obj/*.o deps/*.d bin/* 

cont:
	while true; do clear; date; LANG=C make; echo "make returns '$$?'";\
	 inotifywait -e modify -r . --exclude '(~$$|\.swp$$)' 2>/dev/null; done

include $(patsubst src/%.c,deps/%.d,$(wildcard src/*.c))