2011-07-29 05:20:18 +03:00
|
|
|
#
|
|
|
|
# Makefile - Makefile of ptrude
|
|
|
|
#
|
|
|
|
# Written 2011 by Werner Almesberger
|
|
|
|
# Copyright 2011 by Werner Almesberger
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
|
|
|
|
SHELL = /bin/bash
|
|
|
|
|
|
|
|
MAIN = ptrude
|
2011-07-29 20:32:40 +03:00
|
|
|
OBJS = $(MAIN).o path.o extrude.o
|
2011-07-29 05:20:18 +03:00
|
|
|
|
|
|
|
CFLAGS = -Wall -g -Wshadow -Wmissing-prototypes \
|
|
|
|
-Wmissing-declarations -Wno-format-zero-length
|
2011-07-29 04:31:25 +03:00
|
|
|
LDFLAGS = -lm
|
|
|
|
|
2011-07-29 05:20:18 +03:00
|
|
|
# ----- 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 -----------------------------------------------------------------
|
2011-07-29 04:31:25 +03:00
|
|
|
|
2011-07-29 05:20:18 +03:00
|
|
|
.PHONY: clean try
|
2011-07-29 04:31:25 +03:00
|
|
|
|
2011-07-29 05:20:18 +03:00
|
|
|
$(MAIN): $(OBJS)
|
|
|
|
|
|
|
|
try: $(MAIN)
|
2011-07-29 06:25:28 +03:00
|
|
|
./$(MAIN) -d try 1 0.1 | tee out
|
2011-07-29 04:31:25 +03:00
|
|
|
|
2011-08-01 01:17:05 +03:00
|
|
|
t2: $(MAIN)
|
|
|
|
./$(MAIN) tp ts 25 0.1 >out.stl
|
|
|
|
|
2011-07-29 04:31:25 +03:00
|
|
|
clean:
|
2011-07-29 05:20:18 +03:00
|
|
|
rm -f $(OBJS) $(OBJS:.o=.d)
|
|
|
|
|
|
|
|
spotless: clean
|
|
|
|
rm -f $(MAIN)
|
|
|
|
|
|
|
|
# ----- 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)
|