Commit 8ba14fb8 authored by Célestin Marot's avatar Célestin Marot
Browse files

makefile simplification again

parent e8319735
# compilation and linking flags
CFLAGS=-Wall -Wextra -O3 -g -DNDEBUG
CFLAGS=-Wall -Wextra -O3 -DNDEBUG
LDFLAGS=-lm
# directories
SRCDIR=src
OBJDIR=.cache
BINDIR=bin
# targets
SRC=$(wildcard $(SRCDIR)/*.c)
OBJ=$(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
EXE0=$(BINDIR)/test
EXE1=$(BINDIR)/benchmark
OBJ0=$(filter-out $(OBJDIR)/benchmark.o, $(OBJ))
OBJ1=$(filter-out $(OBJDIR)/test.o, $(OBJ))
SRC=$(wildcard src/*.c)
OBJ=$(SRC:src/%.c=$(OBJDIR)/%.o)
EXE=$(BINDIR)/test $(BINDIR)/benchmark
all: $(EXE0) $(EXE1)
all: $(EXE)
$(EXE0): $(OBJ0) | $(BINDIR)
$(EXE1): $(OBJ1) | $(BINDIR)
$(BINDIR)/test: $(OBJDIR)/HXTSPR.o $(OBJDIR)/predicates.o $(OBJDIR)/test.o
$(BINDIR)/benchmark: $(OBJDIR)/HXTSPR.o $(OBJDIR)/predicates.o $(OBJDIR)/benchmark.o
$(EXE0) $(EXE1):
$(EXE): | $(BINDIR)
$(CC) -o $@ $^ $(LDFLAGS)
# additional dependencies to headers
$(OBJDIR)/predicates.o: $(SRCDIR)/predicates.h
$(OBJDIR)/HXTSPR.o: $(SRCDIR)/HXTSPR.h $(SRCDIR)/predicates.h
$(OBJDIR)/test.o: $(SRCDIR)/HXTSPR.h
$(OBJDIR)/benchmark.o: $(SRCDIR)/HXTSPR.h
$(OBJDIR)/predicates.o: src/predicates.h
$(OBJDIR)/HXTSPR.o: src/HXTSPR.h src/predicates.h
$(OBJDIR)/test.o: src/HXTSPR.h
$(OBJDIR)/benchmark.o: src/HXTSPR.h
$(OBJ): $(OBJDIR)/%.o: $(SRCDIR)/%.c | $(OBJDIR)
$(OBJ): $(OBJDIR)/%.o: src/%.c | $(OBJDIR)
# @echo $@ depends on $^
$(CC) $(CFLAGS) -o $@ -c $< $(LDFLAGS)
......
......@@ -1090,12 +1090,16 @@ allocation_error:
static inline void SPR_terminate(SPRCavity* SPR)
{
free(SPR->steps.array);
SPR->steps.array = NULL;
free(SPR->map.faces);
SPR->map.faces = NULL;
#ifdef SPR_SAVE_QUALITIES
free(SPR->map.qualities);
SPR->map.qualities = NULL;
#endif
#ifdef SPR_SAVE_ORIENT3D
free(SPR->map.orient3d);
SPR->map.orient3d = NULL;
#endif
}
......
/* This file is part of HXTSPR. *
*
HXTSPR 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 3 of the License, or *
(at your option) any later version. *
*
HXTSPR is distributed in the hope that it will be useful, *
but WITHOUT ANY WARRANTY; without even the implied warranty of *
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
GNU General Public License for more details. *
*
You should have received a copy of the GNU General Public License *
along with HXTSPR. If not, see <http://www.gnu.org/licenses/>. *
*
See the COPYING file for the GNU General Public License . *
*
Author: Célestin Marot (celestin.marot@uclouvain.be) */
/**********************************************************
* Same benchmark as in the paper *
* "REVIVING THE SEARCH FOR OPTIMAL TETRAHEDRALIZATIONS", *
* section 2.5 *
**********************************************************/
#include "HXTSPR.h"
#include <math.h>
#include <time.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment