Commit 98fe486b authored by Célestin Marot's avatar Célestin Marot
Browse files

Makefile working with new structure

parent 828f87de
......@@ -10,26 +10,35 @@ BINDIR=bin
# targets
EXE=$(BINDIR)/test
SRC=$(wildcard $(SRCDIR)/*.c)
OBJ=$(SRC:$(SRCDIR)/%.c=$(CACHEDIR)/%.o)
OBJ=$(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
# all:
# @echo $(EXE)
# @echo $(SRC)
# @echo $(OBJ)
$(EXE): $(OBJ) | $(BINDIR)
$(CC) -o $@ $^ $(LDFLAGS)
$(SRCDIR)/predicates.o: $(SRCDIR)/predicates.c $(SRCDIR)/predicates.h
$(SRCDIR)/HXTSPR.o: $(SRCDIR)/HXTSPR.c $(SRCDIR)/HXTSPR.h $(SRCDIR)/predicates.h
$(SRCDIR)/test.o: $(SRCDIR)/test.c $(SRCDIR)/HXTSPR.h
$(OBJDIR)/predicates.o: $(SRCDIR)/predicates.c $(SRCDIR)/predicates.h
$(OBJDIR)/HXTSPR.o: $(SRCDIR)/HXTSPR.c $(SRCDIR)/HXTSPR.h $(SRCDIR)/predicates.h
$(OBJDIR)/test.o: $(SRCDIR)/test.c $(SRCDIR)/HXTSPR.h
$(OBJ): | $(OBJDIR)
$(OBJ): | $(OBJDIR)
# @echo $@ depends on $^
$(CC) $(CFLAGS) -o $@ -c $< $(LDFLAGS)
$(BINDIR):
mkdir $@
mkdir -p $@
$(OBJDIR):
mkdir $@
mkdir -p $@
help:
less README.md
.PHONY: all help
clean:
rm -r .cache
.PHONY: all help clean
......@@ -102,11 +102,7 @@ of your code.
## run and see output
./test && gmsh out.msh
## cleaning everything
git clean -f
bin/test && gmsh out.msh
---
......
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