summaryrefslogtreecommitdiffabout
path: root/Makefile
Side-by-side diff
Diffstat (limited to 'Makefile') (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile49
1 files changed, 45 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 00f7ea0..e6eb882 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,14 @@
-CFLAGS=-ggdb
-alck: lex.yy.o y.tab.o alck.o slist.o
- cc -ggdb -o $@ $^
+CFLAGS=-O2 -g
+PREFIX=/usr/local
+BINDIR=$(PREFIX)/bin
+MANDIR=$(PREFIX)/share/man
+PACKAGE=alck
+VERSION=1.0
+DISTFILES=COPYING README Makefile gram.y lex.l $(SRCS) $(INCS) alck.1
+SRCS=lex.yy.c y.tab.c alck.c slist.c
+OBJS=$(SRCS:.c=.o)
+INCS=alck.h y.tab.h
+
+alck: $(OBJS)
+ cc $(CFLAGS) -o alck $(OBJS)
@@ -12,2 +22,33 @@ lex.yy.o: lex.yy.c y.tab.h
-clean:; rm -rf *.o ckaliases \ No newline at end of file
+clean:; rm -f *.o ckaliases
+
+allclean: all
+ rm -f lex.yy.c y.tab.[ch]
+
+install-bin: alck
+ mkdir -p $(DESTDIR)$(BINDIR)
+ cp alck $(DESTDIR)$(BINDIR)
+
+install-man: alck.1
+ mkdir -p $(DESTDIR)$(MANDIR)/man1
+ cp alck.1 $(DESTDIR)$(MANDIR)/man1
+
+install: install-bin install-man
+
+distdir = $(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+ rm -rf $(distdir)
+ mkdir $(distdir)
+ cp $(DISTFILES) $(distdir)
+
+dist: distdir
+ tar cfz $(distdir).tar.gz $(distdir)
+ rm -rf $(distdir)
+
+distcheck: distdir
+ mkdir $(distdir)/_inst; \
+ cd $(distdir) || exit 2;\
+ make || exit 2; \
+ make DESTDIR=`pwd`/_inst install || exit 2
+ make dist

Return to:

Send suggestions and report system problems to the System administrator.