Skip to content

Commit

Permalink
Rewrite Makefile
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AltraMayor committed Aug 12, 2014
1 parent 66be2fd commit 01e8140
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.d
*.o
*~
24 changes: 17 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 01e8140

Please sign in to comment.