Root/ptrude/Makefile

1#
2# Makefile - Makefile of ptrude
3#
4# Written 2011 by Werner Almesberger
5# Copyright 2011 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
15MAIN = ptrude
16OBJS = $(MAIN).o path.o extrude.o
17
18CFLAGS = -Wall -g -Wshadow -Wmissing-prototypes \
19         -Wmissing-declarations -Wno-format-zero-length
20LDFLAGS = -lm
21
22# ----- Verbosity control -----------------------------------------------------
23
24CC_normal := $(CC)
25DEPEND_normal := $(CPP) $(CFLAGS) -MM -MG
26
27CC_quiet = @echo " CC " $@ && $(CC_normal)
28DEPEND_quiet = @$(DEPEND_normal)
29
30ifeq ($(V),1)
31    CC = $(CC_normal)
32    DEPEND = $(DEPEND_normal)
33else
34    CC = $(CC_quiet)
35    DEPEND = $(DEPEND_quiet)
36endif
37
38# ----- Rules -----------------------------------------------------------------
39
40.PHONY: clean try
41
42$(MAIN): $(OBJS)
43
44try: $(MAIN)
45        ./$(MAIN) -d try 1 0.1 | tee out
46
47t2: $(MAIN)
48        ./$(MAIN) tp ts 25 0.1 >out.stl
49
50clean:
51        rm -f $(OBJS) $(OBJS:.o=.d)
52
53spotless: clean
54        rm -f $(MAIN)
55
56# ----- Dependencies ----------------------------------------------------------
57
58# compile and generate dependencies, from fped, based on
59# http://scottmcpeak.com/autodepend/autodepend.html
60
61%.o: %.c
62        $(CC) -c $(CFLAGS) $*.c -o $*.o
63        $(DEPEND) $*.c | \
64          sed -e \
65            '/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \
66            -e '$${g;p;}' -e d >$*.d; \
67          [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; }
68
69-include $(OBJS:.o=.d)
70

Archive Download this file

Branches:
master



interactive