src/Makefile

changeset 104
1b7716b156a4
parent 101
0cb645809b1a
--- a/src/Makefile	Sat Jul 04 12:28:16 2026 +0200
+++ b/src/Makefile	Sun Jul 05 12:26:02 2026 +0200
@@ -24,22 +24,29 @@
 include ../config.mk
 
 BUILD_DIR = ../build
+MAN_DIR = ../man
 SRC = arguments.c bfile_heuristics.c cline.c regex_parser.c scanner.c \
 	  settings.c string_list.c
 OBJ = $(SRC:%.c=$(BUILD_DIR)/%.o)
 CFLAGS += -DVERSION='"$(VERSION)"'
 
-all: $(BUILD_DIR)/cline FORCE
+all: $(BUILD_DIR)/cline $(BUILD_DIR)/cline.1.gz FORCE
 	@echo "Build successful."
 
-install: $(BUILD_DIR)/cline FORCE
-	cd .. && cp "build/cline" "$(bindir)/cline"
+install: $(BUILD_DIR)/cline $(BUILD_DIR)/cline.1.gz FORCE
+	cp "$(BUILD_DIR)/cline" "$(bindir)/cline"
 	@echo "Installed to: $(bindir)/cline"
+	cp "$(BUILD_DIR)/cline.1.gz" "$(mandir)/man1/cline.1.gz"
+	@echo "Man page:     $(mandir)/man1/cline.1.gz"
 
 $(BUILD_DIR)/cline: $(OBJ)
 	@echo "Linking executable..."
 	$(CC) $(LDFLAGS) -o $@ $^
 
+$(BUILD_DIR)/cline.1.gz: $(MAN_DIR)/cline.1
+	cp $< $(BUILD_DIR)/
+	gzip $(BUILD_DIR)/cline.1
+
 FORCE:
 
 $(BUILD_DIR)/arguments.o: arguments.c arguments.h stdinc.h string_list.h

mercurial