Introduction
Introduction Statistics Contact Development Disclaimer Help
Makefile: improve Makefile, sync from hurl Makefile - gopherproxy-c - Gopher HT…
git clone git://git.codemadness.org/gopherproxy-c
Log
Files
Refs
README
LICENSE
---
commit ec71ea5200ff67c6c121dca56c8e50772488163c
parent 7f0e6929a919fc00a9af4b4858a4d43a89a25e05
Author: Hiltjo Posthuma <[email protected]>
Date: Sat, 3 Aug 2024 15:03:26 +0200
Makefile: improve Makefile, sync from hurl Makefile
Diffstat:
M Makefile | 52 +++++++++++++++++++++++++----…
1 file changed, 42 insertions(+), 10 deletions(-)
---
diff --git a/Makefile b/Makefile
@@ -1,19 +1,51 @@
.POSIX:
-BIN = gopherproxy
-OBJ = $(BIN:=.o)
+NAME = gopherproxy
+VERSION = 0.1
+
+PREFIX = /usr/local
+BINDIR = ${PREFIX}/bin
+MANDIR = ${PREFIX}/man/man1
+
+GOPHER_CFLAGS = ${CFLAGS}
+GOPHER_LDFLAGS = ${LDFLAGS}
+GOPHER_CPPFLAGS = -D_DEFAULT_SOURCE -D_GNU_SOURCE -D_BSD_SOURCE
# build static: useful in www chroot.
-LDFLAGS += -static
-# Linux
-#CPPFLAGS += -D_DEFAULT_SOURCE
+GOPHER_LDFLAGS = ${LDFLAGS} -static
+
+SRC = gopherproxy.c
+OBJ = ${SRC:.c=.o}
+
+all: ${NAME}
-all: $(BIN)
+.c.o:
+ ${CC} ${GOPHER_CFLAGS} ${GOPHER_CPPFLAGS} -c $<
-$(BIN): $(OBJ)
- $(CC) $(OBJ) $(LDFLAGS) -o $@
+${OBJ}:
-$(OBJ): Makefile
+${NAME}: ${OBJ}
+ ${CC} -o $@ ${OBJ} ${GOPHER_LDFLAGS}
clean:
- rm -f $(BIN) $(OBJ)
+ rm -f ${NAME} ${OBJ} ${NAME}-${VERSION}.tar.gz
+
+install: all
+ mkdir -p "${DESTDIR}${BINDIR}"
+ cp -f ${NAME} "${DESTDIR}${BINDIR}"
+ chmod 755 "${DESTDIR}${BINDIR}/${NAME}"
+ mkdir -p "${DESTDIR}${MANDIR}"
+
+uninstall:
+ rm -f "${DESTDIR}${BINDIR}/${NAME}"
+
+dist: clean
+ rm -rf "${NAME}-${VERSION}"
+ mkdir -p ${NAME}-${VERSION}
+ cp -R README LICENSE Makefile \
+ ${NAME}.c ${NAME}-${VERSION}
+ tar cf - ${NAME}-${VERSION} | \
+ gzip -c > "${NAME}-${VERSION}.tar.gz"
+ rm -rf "${NAME}-${VERSION}"
+
+.PHONY: all clean dist install uninstall
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.