Rewrite Makefile

This rewrite of the Makefile takes advantage of the fact that
the Makefile has been unified for all supported operating systems
to properly express source-file dependencies.
This commit is contained in:
Michel Machado 2014-08-12 08:14:04 -04:00
parent 66be2fddb9
commit 01e8140ece
2 changed files with 18 additions and 7 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
*.d
*.o
*~

View File

@ -1,9 +1,19 @@
all:
gcc -Wall -c utils.c
gcc -Wall -c f3write.c
gcc -Wall -c f3read.c
gcc -o f3write utils.o f3write.o -lm
gcc -o f3read utils.o f3read.o
CC = gcc
CFLAGS = -Wall -MMD
TARGETS = f3write f3read
all: $(TARGETS)
f3write: utils.o f3write.o
$(CC) -o $@ $^ -lm
f3read: utils.o f3read.o
$(CC) -o $@ $^
-include *.d
PHONY: clean
clean:
rm -f *.o f3write f3read
rm -f *.o $(TARGETS)