Root/
| 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 | |
| 13 | SHELL = /bin/bash |
| 14 | |
| 15 | MAIN = ptrude |
| 16 | OBJS = $(MAIN).o path.o extrude.o |
| 17 | |
| 18 | CFLAGS = -Wall -g -Wshadow -Wmissing-prototypes \ |
| 19 | -Wmissing-declarations -Wno-format-zero-length |
| 20 | LDFLAGS = -lm |
| 21 | |
| 22 | # ----- Verbosity control ----------------------------------------------------- |
| 23 | |
| 24 | CC_normal := $(CC) |
| 25 | DEPEND_normal := $(CPP) $(CFLAGS) -MM -MG |
| 26 | |
| 27 | CC_quiet = @echo " CC " $@ && $(CC_normal) |
| 28 | DEPEND_quiet = @$(DEPEND_normal) |
| 29 | |
| 30 | ifeq ($(V),1) |
| 31 | CC = $(CC_normal) |
| 32 | DEPEND = $(DEPEND_normal) |
| 33 | else |
| 34 | CC = $(CC_quiet) |
| 35 | DEPEND = $(DEPEND_quiet) |
| 36 | endif |
| 37 | |
| 38 | # ----- Rules ----------------------------------------------------------------- |
| 39 | |
| 40 | .PHONY: clean try |
| 41 | |
| 42 | $(MAIN): $(OBJS) |
| 43 | |
| 44 | try: $(MAIN) |
| 45 | ./$(MAIN) -d try 1 0.1 | tee out |
| 46 | |
| 47 | t2: $(MAIN) |
| 48 | ./$(MAIN) tp ts 25 0.1 >out.stl |
| 49 | |
| 50 | clean: |
| 51 | rm -f $(OBJS) $(OBJS:.o=.d) |
| 52 | |
| 53 | spotless: 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 |
Branches:
master
