Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ version = 1.5.2
tarname = $(package)
distdir = $(tarname)-$(version)

all clean check nyancat:
all clean check:
cd src && $(MAKE) $@

nyancat: src/nyancat.o
cd src && $(MAKE) $@

src/nyancat.o: src/nyancat.c src/telnet.h src/animation.c
cd src && $(MAKE) nyancat.o

dist: $(distdir).tar.gz

$(distdir).tar.gz: $(distdir)
Expand Down Expand Up @@ -36,4 +42,4 @@ install: all
install src/nyancat /usr/bin/${package}
gzip -9 -c < nyancat.1 > /usr/share/man/man1/nyancat.1.gz

.PHONY: FORCE all clean check dist distcheck install
.PHONY: FORCE all clean check dist distcheck install nyancat
10 changes: 7 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
Deps_nyancat = src/nyancat.c
OBJECTS = nyancat.o

CC ?=
CFLAGS ?= -g -Wall -Wextra -std=c99 -pedantic -Wwrite-strings
CFLAGS ?= -g -Wall -Wextra -std=c99 -pedantic -Wwrite-strings -MMD -MP
CPPFLAGS ?=
LDFLAGS ?=
DEPFILES = $(OBJECTS:.o=.d)

all: nyancat

nyancat: $(OBJECTS)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@

clean:
-rm -f $(OBJECTS) nyancat
clean:
-rm -f $(OBJECTS) nyancat $(DEPFILES)

check: all
# Unit tests go here. None currently.
@echo "*** ALL TESTS PASSED ***"

-include $(DEPFILES)

.PHONY: all clean check