Permalink
Browse files

Add install, dist and rpm targets to Makefile

Update ignore patterns
  • Loading branch information...
1 parent c243d4d commit b9db32589cbb3ede06bfeeaf402bc220f36c6193 @essiene committed Jan 6, 2009
Showing with 38 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +33 −0 Makefile
View
@@ -7,3 +7,8 @@ commit
listen.erl
*~
ebin
+*.tar
+*.gz
+*.bz2
+*.rpm
+erlami-*/
View
@@ -1,3 +1,10 @@
+NAME=erlami
+VERSION=0.6
+ERL_LIB=/usr/lib/erlang/lib
+EBIN_DIR=ebin
+INCLUDE_DIR=include
+SRC_DIR=src
+
all:
@cd src; make
@@ -9,4 +16,30 @@ runsym: all
clean:
@cd src; make clean
+ @cd src;make clean
+ @cd tests;make clean
@rm -rf ebin
+ @rm -f erl_crash.dump
+ @rm -f *.tar.gz
+ @rm -rf $(NAME)-$(VERSION)
+
+install: all
+ @mkdir -p $(DESTDIR)/$(ERL_LIB)/$(NAME)-$(VERSION)/{ebin,include,src}
+ @cp -r $(EBIN_DIR)/* $(DESTDIR)/$(ERL_LIB)/$(NAME)-$(VERSION)/ebin/
+ @cp -r $(INCLUDE_DIR)/* $(DESTDIR)/$(ERL_LIB)/$(NAME)-$(VERSION)/include/
+ @cp -r $(SRC_DIR)/* $(DESTDIR)/$(ERL_LIB)/$(NAME)-$(VERSION)/src/
+
+dist: clean
+ @mkdir -p $(NAME)-$(VERSION)
+ @cp TODO README Makefile $(NAME)-$(VERSION)
+ @cp -r include src tests $(NAME)-$(VERSION)
+ @tar -czvf $(NAME)-$(VERSION).tar.gz $(NAME)-$(VERSION)
+ @rm -rf $(NAME)-$(VERSION)
+
+rpm: dist
+ @rm -rf /usr/src/redhat/SOURCES/$(NAME)*
+ @rm -rf /usr/src/redhat/RPMS/i386/$(NAME)*
+ @mv $(NAME)-$(VERSION).tar.gz /usr/src/redhat/SOURCES/
+ @cp $(NAME).spec /usr/src/redhat/SPECS/
+ @rpmbuild -bb /usr/src/redhat/SPECS/$(NAME).spec
+ @mv /usr/src/redhat/RPMS/i386/$(NAME)*.rpm .

0 comments on commit b9db325

Please sign in to comment.