From 473ea1c663f6ccf4ccdc043ac5ffd95f1acb38e0 Mon Sep 17 00:00:00 2001 From: Brian Smyth Date: Wed, 30 Sep 2009 12:27:09 -0400 Subject: SLOCCount formula. SLOCCount is a set of tools for counting physical Source Lines of Code (SLOC) in a large number of languages of a potentially large set of programs. --- Library/Formula/sloccount.rb | 259 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 Library/Formula/sloccount.rb (limited to 'Library') diff --git a/Library/Formula/sloccount.rb b/Library/Formula/sloccount.rb new file mode 100644 index 000000000..6a7b1fa80 --- /dev/null +++ b/Library/Formula/sloccount.rb @@ -0,0 +1,259 @@ +require 'brewkit' + +class Sloccount pascal_count.c +- +-pascal_count$(EXE_SUFFIX): pascal_count.c +- $(CC) pascal_count.c -o pascal_count$(EXE_SUFFIX) +- +-jsp_count.c: jsp_count.l driver.c driver.h +- flex -Cfe -t jsp_count.l > jsp_count.c +- +-jsp_count$(EXE_SUFFIX): jsp_count.c +- $(CC) jsp_count.c -o jsp_count$(EXE_SUFFIX) +- +-sloccount.1.gz: sloccount.1 +- gzip -c sloccount.1 > sloccount.1.gz +- +-# Currently "java_count" is the same as "c_count": +-java_count$(EXE_SUFFIX): c_count$(EXE_SUFFIX) +- cp -p c_count$(EXE_SUFFIX) java_count$(EXE_SUFFIX) +- +-# This is USC's code counter, not built by default: +-c_lines: C_LINES.C +- $(CC) C_LINES.C -o c_lines$(EXE_SUFFIX) +- +- +-install_programs: all +- $(INSTALL) $(EXECUTABLES) $(INSTALL_DIR) +- +-uninstall_programs: +- cd $(INSTALL_DIR) && rm -f $(EXECUTABLES) +- +-install_man: +- $(INSTALL_A_DIR) $(MAN_DIR_MAN1) +- $(INSTALL) $(MANPAGES) $(MAN_DIR_MAN1) +- +-uninstall_man: +- cd $(MAN_DIR_MAN1) && rm -f $(MANPAGES) +- +-install_docs: install_man +- $(INSTALL_A_DIR) $(DOC_DIR) +- $(INSTALL) $(MYDOCS) $(DOC_DIR) +- +-uninstall_docs: +- cd $(DOC_DIR) && rm -f $(MYDOCS) && rmdir $(DOC_DIR) +- +- +-install: install_programs install_man install_docs +- +-uninstall: uninstall_programs uninstall_docs uninstall_man +- +- +-clean: +- -rm -f $(COMPILED_EXECUTABLES) core sloccount.1.gz +- +-phptest: php_count +- ./php_count *.php +- ./php_count /usr/share/php/*.php +- ./php_count /usr/share/php/*/*.php +- +-# "make distribute" creates the tarball. +- +- +-distribute: clean $(MANPAGES) +- rm -f sloccount-$(VERSION).tgz +- rm -f sloccount-$(VERSION).tar.gz +- mkdir 9temp +- cp -pr [A-Za-z]* 9temp +- mv 9temp $(VERSIONEDNAME) +- rm -f $(VERSIONEDNAME)/*.tgz +- rm -f $(VERSIONEDNAME)/*.tar.gz +- rm -f $(VERSIONEDNAME)/*.rpm +-# rm -f $(VERSIONEDNAME)/*.1.gz +- rm -f $(VERSIONEDNAME)/C_LINES.C +- rm -f $(VERSIONEDNAME)/java_lines.c +- rm -f $(VERSIONEDNAME)/c_lines +- tar -cvf - $(VERSIONEDNAME)/* | \ +- gzip --best > $(VERSIONEDNAME).tar.gz +- chown --reference=README $(VERSIONEDNAME).tar.gz +- chmod a+rX * +- rm -fr $(VERSIONEDNAME) +- +-my_install: distribute +- chmod a+rX * +- cp -p sloccount-$(VERSION).tar.gz $(POSTED_DIR) +- cp -p sloccount.html $(POSTED_DIR) +- cp -p ChangeLog $(POSTED_DIR) +- cp -p TODO $(POSTED_DIR) +- cp -p /usr/src/redhat/RPMS/$(ARCH)/$(VERSIONEDNAME)-$(RPM_VERSION)*.rpm $(POSTED_DIR) +- cp -p /usr/src/redhat/SRPMS/$(VERSIONEDNAME)-$(RPM_VERSION)*.src.rpm $(POSTED_DIR) +- +- +-rpm: distribute +- cp $(VERSIONEDNAME).tar.gz /usr/src/redhat/SOURCES +- cp sloccount.spec /usr/src/redhat/SPECS +- cd /usr/src/redhat/SPECS +- # Uninstall current sloccount if any; ignore errors if not installed. +- -rpm -e sloccount +- $(RPMBUILD) sloccount.spec +- chmod a+r /usr/src/redhat/RPMS/$(ARCH)/$(VERSIONEDNAME)-$(RPM_VERSION)*.rpm +- chmod a+r /usr/src/redhat/SRPMS/$(VERSIONEDNAME)-$(RPM_VERSION)*.src.rpm +- rpm -ivh /usr/src/redhat/RPMS/$(ARCH)/$(VERSIONEDNAME)-$(RPM_VERSION)*.rpm +- echo "Use rpm -e $(NAME) to remove the package" +- +- -- cgit v1.2.3