Root/solidify/Makefile

1#
2# Makefile - Makefile of solidify
3#
4# Written 2010, 2014 by Werner Almesberger
5# Copyright 2010, 2014 by Werner Almesberger
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12
13SHELL = /bin/bash
14
15OBJS = array.o face.o gui_util.o histo.o level.o matrix.o overlap.o povray.o \
16       project.o solidify.o style.o
17
18CFLAGS_WARN = -Wall -Wshadow -Wmissing-prototypes \
19          -Wmissing-declarations -Wno-format-zero-length
20
21CFLAGS = $(CFLAGS_WARN) -g -O9 `pkg-config --cflags gtk+-2.0`
22LDFLAGS =
23LDLIBS = -lm `pkg-config --libs gtk+-2.0`
24
25# ----- Verbosity control -----------------------------------------------------
26
27CC_normal := $(CC)
28DEPEND_normal := $(CPP) $(CFLAGS) -MM -MG
29
30CC_quiet = @echo " CC " $@ && $(CC_normal)
31DEPEND_quiet = @$(DEPEND_normal)
32
33ifeq ($(V),1)
34    CC = $(CC_normal)
35    DEPEND = $(DEPEND_normal)
36else
37    CC = $(CC_quiet)
38    DEPEND = $(DEPEND_quiet)
39endif
40
41# ----- Rules -----------------------------------------------------------------
42
43.PHONY: all clean spotless
44
45all: solidify
46
47solidify: $(OBJS)
48
49clean:
50        rm -f $(OBJS) $(OBJS:.o=.d)
51
52spotless: clean
53        rm -f solidify
54
55# ----- Experimental execution ------------------------------------------------
56
57NAME=baseframe
58TOP=top
59BOTTOM=bottom
60D=0.86
61
62PRJ=http://projects.qi-hardware.com/index.php/p/ben-scans/source/tree/master
63DIR=$(PRJ)/data/csv
64FACE_A=$(DIR)/ben-$(NAME)-$(TOP)-100um.txt.bz2
65FACE_B=$(DIR)/ben-$(NAME)-$(BOTTOM)-100um.txt.bz2
66
67
68.PHONY: new run pov disp
69
70new: solidify
71        rm -f $(NAME).sfy
72        ./solidify $(NAME).sfy $(FACE_A) $(FACE_B) $(D)
73
74run: solidify
75        ./solidify $(NAME).sfy
76
77pov: $(NAME).pov $(NAME).inc
78        povray +A +P -W1280 -H900 $(NAME).pov
79
80disp:
81        display $(NAME).png
82
83$(NAME).pov: template.pov
84        sed 's/NAME/$(NAME)/' template.pov >$@ || { rm -f $@; exit 1; }
85
86$(NAME).inc: $(NAME).sfy
87        ./solidify -p $<
88
89# ----- Dependencies ----------------------------------------------------------
90
91# compile and generate dependencies, from fped, based on
92# http://scottmcpeak.com/autodepend/autodepend.html
93
94%.o: %.c
95        $(CC) -c $(CFLAGS) $*.c -o $*.o
96        $(DEPEND) $*.c | \
97          sed -e \
98            '/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \
99            -e '$${g;p;}' -e d >$*.d; \
100          [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; }
101
102-include $(OBJS:.o=.d)
103

Archive Download this file

Branches:
master



interactive