pkgsrc/devel/sloccount/patches/patch-makefile
khorben bf3c7f285c Import sloccount 2.26 as devel/sloccount
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.
2017-09-04 11:00:36 +00:00

79 lines
2.6 KiB
Text

$NetBSD: patch-makefile,v 1.1 2017/09/04 11:00:36 khorben Exp $
- Add support for CFLAGS and LDFLAGS
- Correct permissions when installing manual pages and documentation
--- makefile.orig 2004-08-01 18:52:06.000000000 +0000
+++ makefile
@@ -37,7 +37,9 @@ EXE_SUFFIX=
# Set this to your C compiler, if it's not "gcc"; a likely alternative is "cc".
# The "-Wall" option turns on warnings in gcc. gcc users might also want
# to consider using "-Werror", which turns warnings into errors.
-CC=gcc -Wall
+CC=gcc
+CFLAGS=-Wall
+LDFLAGS=
# Set this to the name of your "install" program. On some systems,
# "install -C" would be useful (so unchanged files won't be modified),
@@ -128,28 +130,28 @@ MYDOCS=sloccount.html README TODO Change
all: $(COMPILED_EXECUTABLES)
lexcount1$(EXE_SUFFIX): lexcount1.c
- $(CC) lexcount1.c -o lexcount1$(EXE_SUFFIX)
+ $(CC) $(CFLAGS) $(LDFLAGS) lexcount1.c -o lexcount1$(EXE_SUFFIX)
c_count$(EXE_SUFFIX): c_count.c
- $(CC) c_count.c -o c_count$(EXE_SUFFIX)
+ $(CC) $(CFLAGS) $(LDFLAGS) c_count.c -o c_count$(EXE_SUFFIX)
php_count$(EXE_SUFFIX): php_count.c
- $(CC) php_count.c -o php_count$(EXE_SUFFIX)
+ $(CC) $(CFLAGS) $(LDFLAGS) php_count.c -o php_count$(EXE_SUFFIX)
pascal_count.c: pascal_count.l driver.c driver.h
flex -Cfe -t pascal_count.l > pascal_count.c
pascal_count$(EXE_SUFFIX): pascal_count.c
- $(CC) pascal_count.c -o pascal_count$(EXE_SUFFIX)
+ $(CC) $(CFLAGS) $(LDFLAGS) 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)
+ $(CC) $(CFLAGS) $(LDFLAGS) jsp_count.c -o jsp_count$(EXE_SUFFIX)
ml_count$(EXE_SUFFIX): ml_count.c
- $(CC) ml_count.c -o ml_count$(EXE_SUFFIX)
+ $(CC) $(CFLAGS) $(LDFLAGS) ml_count.c -o ml_count$(EXE_SUFFIX)
sloccount.1.gz: sloccount.1
gzip -c sloccount.1 > sloccount.1.gz
@@ -160,7 +162,7 @@ java_count$(EXE_SUFFIX): c_count$(EXE_SU
# This is USC's code counter, not built by default:
c_lines: C_LINES.C
- $(CC) C_LINES.C -o c_lines$(EXE_SUFFIX)
+ $(CC) $(CFLAGS) $(LDFLAGS) C_LINES.C -o c_lines$(EXE_SUFFIX)
install_programs: all
@@ -171,14 +173,14 @@ uninstall_programs:
install_man: $(MANPAGES)
$(INSTALL_A_DIR) $(MAN_DIR_MAN1)
- $(INSTALL) $(MANPAGES) $(MAN_DIR_MAN1)
+ $(INSTALL) -m 0644 $(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)
+ $(INSTALL) -m 0644 $(MYDOCS) $(DOC_DIR)
uninstall_docs:
rm -fr $(DOC_DIR)