2010-09-24 02:05:25 +03:00
|
|
|
SHELL = /bin/bash
|
2010-09-22 23:04:43 +03:00
|
|
|
|
2010-09-24 02:05:25 +03:00
|
|
|
OBJS = array.o face.o histo.o level.o solidify.o
|
2010-09-22 23:04:43 +03:00
|
|
|
|
2010-09-24 02:05:25 +03:00
|
|
|
CFLAGS_WARN = -Wall -Wshadow -Wmissing-prototypes \
|
|
|
|
-Wmissing-declarations -Wno-format-zero-length
|
|
|
|
|
|
|
|
CFLAGS = $(CFLAGS_WARN) -g `pkg-config --cflags gtk+-2.0`
|
|
|
|
LDFLAGS = -lm `pkg-config --libs gtk+-2.0`
|
|
|
|
|
|
|
|
# ----- Verbosity control -----------------------------------------------------
|
|
|
|
|
|
|
|
CC_normal := $(CC)
|
|
|
|
DEPEND_normal := $(CPP) $(CFLAGS) -MM -MG
|
|
|
|
|
|
|
|
CC_quiet = @echo " CC " $@ && $(CC_normal)
|
|
|
|
DEPEND_quiet = @$(DEPEND_normal)
|
|
|
|
|
|
|
|
ifeq ($(V),1)
|
|
|
|
CC = $(CC_normal)
|
|
|
|
DEPEND = $(DEPEND_normal)
|
|
|
|
else
|
|
|
|
CC = $(CC_quiet)
|
|
|
|
DEPEND = $(DEPEND_quiet)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# ----- Rules -----------------------------------------------------------------
|
|
|
|
|
|
|
|
.PHONY: all clean spotless
|
2010-09-22 23:04:43 +03:00
|
|
|
|
|
|
|
all: solidify
|
|
|
|
|
|
|
|
solidify: $(OBJS)
|
|
|
|
|
|
|
|
clean:
|
2010-09-24 02:05:25 +03:00
|
|
|
rm -f $(OBJS) $(OBJS:.o=.d)
|
|
|
|
|
|
|
|
spotless: clean
|
|
|
|
rm -f solidify
|
|
|
|
|
|
|
|
# ----- Dependencies ----------------------------------------------------------
|
|
|
|
|
|
|
|
# compile and generate dependencies, from fped, based on
|
|
|
|
# http://scottmcpeak.com/autodepend/autodepend.html
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
$(CC) -c $(CFLAGS) $*.c -o $*.o
|
|
|
|
$(DEPEND) $*.c | \
|
|
|
|
sed -e \
|
|
|
|
'/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \
|
|
|
|
-e '$${g;p;}' -e d >$*.d; \
|
|
|
|
[ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; }
|
|
|
|
|
|
|
|
-include $(OBJS:.o=.d)
|