7 CLEANFILES += $(TARGETS)
9 .SECONDEXPANSION: # sorry
12 exec_prefix = $(prefix)
13 bindir = $(exec_prefix)/bin
18 v-tag = $(call v-tag_$V,$1)
19 v-tag_0 = @printf " %-8s %s\n" "$1" "$@";
22 CFLAGS = -O2 -g -pedantic -Wall -Werror
27 PROGS += dvd-sector-copy
28 dvd-sector-copy_SRCS = dvd-sector-copy.c
29 dvd-sector-copy_LIBS = -ldvdread -lm
32 SCRIPTS += dvdrip-upload
35 $(call v-tag,CC)$(CC) -c $(CFLAGS) -o$@ -MD -MF $*.dep $<
36 CLEANFILES += *.o *.dep
38 objects = $(addsuffix $(or $2,.o),$(basename $(filter %.c %.s %.S,$1)))
41 program-objects = $(call objects,$($1_SRCS),$2)
42 $(PROGS): %: $$(call program-objects,$$*) $$($$*_DEPS)
43 $(call v-tag,LD)$(LD) $(LDFLAGS) -o$@ \
44 $(call program-objects,$*) $($*_LIBS)
46 INSTALL_bin = $(addprefix inst/,$(PROGS) $(SCRIPTS))
47 install: $(INSTALL_bin)
48 $(INSTALL_bin): inst/%: %
49 $(V_AT)mkdir -p $(bindir)
50 $(call v-tag,INST)install -m755 $* $(bindir)/
55 clean::; rm -f $(CLEANFILES)
57 -include $(foreach p,$(PROGS), $(call program-objects,$p,.dep))