47 lines
967 B
Text
47 lines
967 B
Text
|
don't hardcode gcc
|
||
|
remove -O flags
|
||
|
honor CFLAGS
|
||
|
disable root check for install target
|
||
|
set DIR (for install) to PREFIX
|
||
|
|
||
|
Index: BSDmakefile
|
||
|
--- BSDmakefile.orig
|
||
|
+++ BSDmakefile
|
||
|
@@ -26,14 +26,12 @@
|
||
|
# along with this program. If not, see http://www.gnu.org/licenses/.
|
||
|
|
||
|
OS != uname
|
||
|
-CC = gcc
|
||
|
+CC ?= cc
|
||
|
FLAGS = -fsigned-char -fwrapv -Wall -std=gnu99 -Iinclude
|
||
|
LIBS = -lm -lcrypt
|
||
|
|
||
|
.ifmake debug
|
||
|
- EXTRA = -O0 -g3
|
||
|
.else
|
||
|
- EXTRA = -O3
|
||
|
FLAGS += -DNDEBUG
|
||
|
.endif
|
||
|
|
||
|
@@ -49,6 +47,8 @@ LIBS = -lm -lcrypt
|
||
|
|
||
|
.if ($(OS) == OpenBSD)
|
||
|
LIBS = -lm
|
||
|
+ FLAGS += $(CFLAGS)
|
||
|
+ DIR=${PREFIX}/bin
|
||
|
.endif
|
||
|
|
||
|
DIRS = compile database init runtime seqio symbol util xcall
|
||
|
@@ -115,11 +115,6 @@ debug: ${OBJS}
|
||
|
${CC} ${EXTRA} ${FLAGS} -o ${PROG} ${OBJS} ${LIBS}
|
||
|
|
||
|
install: ${PROG}
|
||
|
- @if [ "$${USER}" != "root" ]; then \
|
||
|
- echo "You must install ${PROG} as root"; \
|
||
|
- exit 1; \
|
||
|
- fi
|
||
|
-
|
||
|
@if [ ! -d ${DIR} ]; then \
|
||
|
mkdir -p ${DIR}; \
|
||
|
fi
|