Skip to content

Commit

Permalink
Makefile: Adding 'dist', 'test' and 'install' targets to create a tar…
Browse files Browse the repository at this point in the history
…ball

and a useful tarball too.
  • Loading branch information
trygvis committed Dec 27, 2009
1 parent a8df92d commit 4183922
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# vim: noexpandtab
sinclude Makefile.local

VERSION = 1.0

CFLAGS ?= -g
CFLAGS += -Wall
CFLAGS += `$(PKG_CONFIG) --cflags $(PKGS)`
Expand Down Expand Up @@ -28,14 +30,23 @@ clean:
indent:
$(INDENT) -npro -kr -i8 -ts8 -sob -l120 -ss -ncs -cp1 $(wildcard *.c *.h)

# It would be awesome if git should just spit out a UTC formatted string - trygve
dist:
date=`git log --date=iso --pretty="format:%ci"|sed -n -e "s,\(....\)-\(..\)-\(..\) \(..\):\(..\).*,\1\2\3-\4\5," -e 1p`; \
git archive --prefix=saleae-logic-libusb-$$date/ HEAD | bzip2 > ../saleae-logic-libusb-$$date.tar.bz2

sinclude .deps
.deps: $(wildcard *.h)
$(CC) $(CFLAGS) $(CPPFLAGS) -MM *.c > .deps
$(MAKE) -C firmware .deps

# Misc

test:

install:
mkdir -p $(DESTDIR)/usr/bin
cp main $(DESTDIR)/usr/bin/slogic
chmod +x $(DESTDIR)/usr/bin/slogic

dist:
date=`git log --date=iso --pretty="format:%ci"|sed -n -e "s,\(....\)-\(..\)-\(..\) \(..\):\(..\).*,\1\2\3\4\5," -e 1p`; \
echo "Creating archive in ../saleae-logic-libusb-$(VERSION)-$$date.tar.gz"; \
git archive --prefix=saleae-logic-libusb-$(VERSION)-$$date/ HEAD | gzip > ../saleae-logic-libusb-$(VERSION)-$$date.tar.gz

.PHONY: dist all run

0 comments on commit 4183922

Please sign in to comment.