Skip to content

Commit

Permalink
Merge pull request #3 from lmartinez-mirror/makefile
Browse files Browse the repository at this point in the history
Makefile rewrite for robustness
  • Loading branch information
stolk authored May 12, 2021
2 parents cdf11a8 + c273b9a commit 36210ff
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
diskgraph: diskgraph.c
cc -D_POSIX_C_SOURCE=199309L -std=c99 -Wall -g -o diskgraph diskgraph.c -lm
CC ?= cc
CFLAGS += -D_POSIX_C_SOURCE=199309L -std=c99 -Wall
LDFLAGS +=

clean:
rm -f ./diskgraph
TARGET = diskgraph
SRC = diskgraph.c
OBJ = $(SRC:.c=.o)

all: $(TARGET)

$(TARGET): $(OBJ)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJ) $(LDFLAGS)

.c.o:
$(CC) $(CFLAGS) -c $< -o $@

clean:
$(RM) *.o $(TARGET)
@echo All clean

0 comments on commit 36210ff

Please sign in to comment.