File: Makefile

package info (click to toggle)
zeroconf 0.9-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 236 kB
  • ctags: 93
  • sloc: ansic: 1,331; sh: 86; makefile: 69
file content (42 lines) | stat: -rw-r--r-- 1,078 bytes parent folder | download
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
32
33
34
35
36
37
38
39
40
41
42

Q=@

CWARN= -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wchar-subscripts -Wcomment -Wformat=2 -Wno-format-extra-args -Wimplicit-int -Werror-implicit-function-declaration -Wmain -Wmissing-braces -Wparentheses -Wswitch -Wundef -Wshadow -Wwrite-strings

CFLAGS=$(CWARN) -std=gnu99 -MMD -O2 -g

SRCS=zeroconf.c delay.c

OBJS= $(SRCS:.c=.o)

TARGET=zeroconf

all: $(TARGET)

clean:
	rm -f $(TARGET) $(OBJS) *.d

zeroconf: zeroconf.o delay.o
	$(Q)echo "Creating $@"
	$(Q)$(CC) $(CFLAGS) -o $@ $^ $(LIBS)


# Automatic dependency generation
# make the 'deps' variable equal to all *.c files
# and replace the '*.c' with '*.d' in the file name
#
deps := ${patsubst %.c,%.d,${wildcard *.c}}

# Make '*.d' dependant on '*.c' and specify how to
# invoke the compiler to turn one ('*.c') into another ('*.d')
${deps}: %.d : %.c
	$(Q)$(CC) -MM $(INCLUDES) $< > $@

ifneq (${MAKECMDGOALS},clean)
-include ${deps}
endif

# replace the inbuilt compilation rule so we get nice output
%.o: %.c
	$(Q)echo "Compiling $<"
	$(Q)$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@