genann/Makefile
Andrew Jeffery afa5df1ffc Makefile: Use $(RM), silencing errors on missing files
$(RM) includes the -f flag, so the clean target now succeeds when files
to remove don't exist. The post-condition of clean is that compilation
artifacts are not present; this is trivially satisfied if they never
existed.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
2017-10-22 08:05:06 +10:30

33 lines
522 B
Makefile

CCFLAGS = -Wall -Wshadow -O2 -g
LFLAGS = -lm
all: test example1 example2 example3 example4
test: test.o genann.o
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
./$@
example1: example1.o genann.o
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
example2: example2.o genann.o
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
example3: example3.o genann.o
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
example4: example4.o genann.o
$(CC) $(CCFLAGS) -o $@ $^ $(LFLAGS)
.c.o:
$(CC) -c $(CCFLAGS) $< -o $@
clean:
$(RM) *.o
$(RM) *.exe
$(RM) persist.txt