Date:2010-09-24 01:05:25 (13 years 6 months ago)
Author:Werner Almesberger
Commit:8eed5e3ecb9d362d5d561bbc102de646347848b9
Message:Makefile cleanup and instrumentation (verbosity, dependencies, etc.)

- solidify/Makefile: added verbosity control (default is silent, enable
verbose output with V=1)
- solidify/Makefile: added "spotless" target
- solidify/Makefile (CFLAGS): moved warning options to CFLAGS_WARN
- solidify/Makefile: added dependency use and generation, with friendly
permission from fped/Makefile
Files: solidify/Makefile (1 diff)

Change Details

solidify/Makefile
1CFLAGS=-Wall -g `pkg-config --cflags gtk+-2.0`
2LDFLAGS=-lm `pkg-config --libs gtk+-2.0`
1SHELL = /bin/bash
32
4OBJS=array.o face.o histo.o level.o solidify.o
3OBJS = array.o face.o histo.o level.o solidify.o
54
6.PHONY: all clean
5CFLAGS_WARN = -Wall -Wshadow -Wmissing-prototypes \
6          -Wmissing-declarations -Wno-format-zero-length
7
8CFLAGS = $(CFLAGS_WARN) -g `pkg-config --cflags gtk+-2.0`
9LDFLAGS = -lm `pkg-config --libs gtk+-2.0`
10
11# ----- Verbosity control -----------------------------------------------------
12
13CC_normal := $(CC)
14DEPEND_normal := $(CPP) $(CFLAGS) -MM -MG
15
16CC_quiet = @echo " CC " $@ && $(CC_normal)
17DEPEND_quiet = @$(DEPEND_normal)
18
19ifeq ($(V),1)
20    CC = $(CC_normal)
21    DEPEND = $(DEPEND_normal)
22else
23    CC = $(CC_quiet)
24    DEPEND = $(DEPEND_quiet)
25endif
26
27# ----- Rules -----------------------------------------------------------------
28
29.PHONY: all clean spotless
730
831all: solidify
932
1033solidify: $(OBJS)
1134
1235clean:
13        rm -f $(OBJS)
36        rm -f $(OBJS) $(OBJS:.o=.d)
37
38spotless: clean
39        rm -f solidify
40
41# ----- Dependencies ----------------------------------------------------------
42
43# compile and generate dependencies, from fped, based on
44# http://scottmcpeak.com/autodepend/autodepend.html
45
46%.o: %.c
47        $(CC) -c $(CFLAGS) $*.c -o $*.o
48        $(DEPEND) $*.c | \
49          sed -e \
50            '/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \
51            -e '$${g;p;}' -e d >$*.d; \
52          [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; }
53
54-include $(OBJS:.o=.d)

Archive Download the corresponding diff file

Branches:
master



interactive