From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UCiHFFBe6WYaAAAAe85BDQ:P1 (envelope-from ) for ; Tue, 17 Sep 2024 12:47:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id UCiHFFBe6WYaAAAAe85BDQ (envelope-from ) for ; Tue, 17 Sep 2024 12:47:44 +0200 X-Envelope-To: patches@johnnyrichard.com Authentication-Results: aspmx1.migadu.com; none Received: from mail-a.sr.ht (mail-a.sr.ht [46.23.81.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 43B9B7A6E8 for ; Tue, 17 Sep 2024 12:47:41 +0200 (CEST) DKIM-Signature: a=rsa-sha256; bh=4EgXcKK2eEhQ/5fNricEsXqXosvM3whIIaRrOFDlzzY=; c=simple/simple; d=lists.sr.ht; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Unsubscribe:List-Subscribe:List-Archive:List-Post:List-ID; q=dns/txt; s=20240113; t=1726570060; v=1; b=mgdKCBJtLXO8SPfX1AyurO3iv5E16PVHmKdTyrnJqO7X39fVPNgTeqQC66PncKB7t3kzB2K1 nkchmZimlOE1QhEUbIQPc76stdhpauP8+1We5RE2TaVfBRo5wWGIqQGNpxnioiUGES/4aSZ50Hu W9FQVnCitFYTHLORTz3+L1TRdT44U7L4KshqOj0erINw1ycwDKy2KTPklTw5liIF4mLGn2FKoqd Nkya8KYz+GTfLTQr17IYmtJajnvTDvdR0C3Q/mXiIDgDNvEkB4LubP/aJp+oNXQ7WC5rXTVQ7Cv NYgH6JeoYeIGQtLFnGszlRUZoB5+MTly3K1oQhC90t3rw== Received: from lists.sr.ht (unknown [46.23.81.154]) by mail-a.sr.ht (Postfix) with ESMTPSA id 96F9920242 for ; Tue, 17 Sep 2024 10:47:40 +0000 (UTC) Received: from out-184.mta1.migadu.com (out-184.mta1.migadu.com [95.215.58.184]) by mail-a.sr.ht (Postfix) with ESMTPS id 01CB92022C for <~johnnyrichard/olang-devel@lists.sr.ht>; Tue, 17 Sep 2024 10:47:40 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=johnnyrichard.com; s=key1; t=1726570059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=riJ1ZsWDVkSKK5LSOBpCsnUOzE7+QZKrsW+kH6jUuZM=; b=G8M4sIn0odO1rXqXH8PpPQ3rMB6CM1LTYca1oTB1gMANSaeGo32HVx+jMJ4/mRlxD2HQek IxZ6oj6N0U6IJtsnyK5CXA6kpIu+eXXZSpVmtBJc+br6ti/Scf04jRb4/N/Cy0xjFX+Qhx vFULMP6PDRgSJTtQJH2LCM+Km10bACyoi3QBwTyrplWF2UE88yzx1PkV79z8MyR3XRy7HT 71mmtIJuoKBy5px7s82n5/DTJGI9oEbBPYSihBHzDiCAvz0q0HkR9XqyGoswwGFVFNBeqh Pa+hjfvb+w9+pr/huc3CN9uM2sIorC6MR17PQYjntLDpCOrTsHRPIcigEhfGcw== From: Johnny Richard To: ~johnnyrichard/olang-devel@lists.sr.ht Cc: Johnny Richard Subject: [PATCH olang v1 1/4] build: add install/uninstall targets for info docs Date: Tue, 17 Sep 2024 14:46:15 +0200 Message-ID: <20240917124716.184501-2-johnny@johnnyrichard.com> In-Reply-To: <20240917124716.184501-1-johnny@johnnyrichard.com> References: <20240917124716.184501-1-johnny@johnnyrichard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Sourcehut-Patchset-Status: UNKNOWN List-Unsubscribe: List-Subscribe: List-Archive: Archived-At: List-Post: List-ID: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel.lists.sr.ht> Sender: ~johnnyrichard/olang-devel <~johnnyrichard/olang-devel@lists.sr.ht> X-Migadu-Flow: FLOW_IN X-Migadu-Country: NL X-Migadu-Spam-Score: -4.00 X-Spam-Score: -4.00 X-Migadu-Queue-Id: 43B9B7A6E8 X-Migadu-Scanner: mx10.migadu.com X-TUID: F8XN9m03iX2J Signed-off-by: Johnny Richard --- .gitignore | 1 + Makefile | 60 +++++++++++++++---- docs/.gitignore | 1 + docs/Makefile | 8 +-- docs/{manual => info}/.gitignore | 0 docs/{manual => info}/Makefile | 0 docs/{manual => info}/_header.html | 0 docs/{manual => info}/contribution-guide.texi | 0 docs/{manual => info}/getting-started.texi | 0 docs/{manual => info}/installation.texi | 0 docs/{manual => info}/introduction.texi | 0 docs/{manual => info}/olang.texi | 0 docs/{manual => info}/specification.texi | 2 +- 13 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 docs/.gitignore rename docs/{manual => info}/.gitignore (100%) rename docs/{manual => info}/Makefile (100%) rename docs/{manual => info}/_header.html (100%) rename docs/{manual => info}/contribution-guide.texi (100%) rename docs/{manual => info}/getting-started.texi (100%) rename docs/{manual => info}/installation.texi (100%) rename docs/{manual => info}/introduction.texi (100%) rename docs/{manual => info}/olang.texi (100%) rename docs/{manual => info}/specification.texi (99%) diff --git a/.gitignore b/.gitignore index a565aae..0fe0790 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ olang build *.o +*.info docs/site.tar.gz tests/*/*_test diff --git a/Makefile b/Makefile index 2f5273b..120cb7f 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,58 @@ -TARGET := olang -SRC_DIR := src -BUILD_DIR := build -CFLAGS := -Werror -Wall -Wextra -Wmissing-declarations -pedantic -std=c11 -ggdb +.POSIX: -SRCS := $(wildcard $(SRC_DIR)/*.c) -HEADERS := $(wildcard $(SRC_DIR)/*.h) -OBJS := $(patsubst $(SRC_DIR)/%.c, $(BUILD_DIR)/%.o, $(SRCS)) +CC := gcc + +CFLAGS := ${CFLAGS} +CFLAGS += -Werror -Wall -Wextra -Wmissing-declarations +CFLAGS += -pedantic -std=c11 -ggdb + +TARGET := olang + +PREFIX ?= /usr/local + +BINDIR ?= ${PREFIX}/bin +DATADIR ?= ${PREFIX}/share +INFODIR ?= ${DATADIR}/info +MANDIR ?= ${DATADIR}/man +SRCDIR := src +BUILDDIR := build + +SRCS := $(wildcard $(SRCDIR)/*.c) +HEADERS := $(wildcard $(SRCDIR)/*.h) +OBJS := $(patsubst $(SRCDIR)/%.c, $(BUILDDIR)/%.o, $(SRCS)) .PHONY: all all: $(TARGET) -$(TARGET): $(BUILD_DIR) $(OBJS) +.PHONY: info +info: olang.info + +# install target + +.PHONY: install +install: install-info + +.PHONY: install-info +install-info: olang.info + install -Dm 644 olang.info ${DESTDIR}${INFODIR}/olang.info + gzip -f ${DESTDIR}${INFODIR}/olang.info + +# uninstall target + +.PHONY: uninstall +uninstall: uninstall-info + +.PHONY: uninstall-info +uninstall-info: + @rm -f ${DESTDIR}${INFODIR}/olang.info.gz + +olang.info: docs/info/*.texi + $(MAKEINFO) docs/info/olang.texi + +$(TARGET): $(BUILDDIR) $(OBJS) $(CC) $(CFLAGS) $(OBJS) -o $(TARGET) -$(BUILD_DIR): +$(BUILDDIR): @mkdir -p $@ .PHONY: format @@ -38,6 +77,7 @@ unit-test: .PHONY: clean clean: + @rm -f olang.info $(MAKE) -C tests/unit/ clean @rm -rf build/ $(TARGET) @@ -55,5 +95,5 @@ docs: docs-dist: $(MAKE) -C docs dist -$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c +$(BUILDDIR)/%.o: $(SRCDIR)/%.c $(CC) $(CFLAGS) -c $< -o $@ diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/docs/Makefile b/docs/Makefile index a38c091..f069ff1 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -14,7 +14,7 @@ all: $(BUILD_DIR) $(STYLE) $(TARGET) manpages manual clean: rm -rf $(BUILD_DIR) rm -f $(DIST_FILE) - make -C manual clean + make -C info clean .PHONY: dist dist: $(DIST_FILE) @@ -43,7 +43,7 @@ $(BUILD_DIR): $(STYLE): $(BUILD_DIR) cp style.css $(SITE_DIR) -$(SITE_DIR)/manual/index.html: manual/*.texi - make -C manual +$(SITE_DIR)/manual/index.html: info/*.texi + make -C info rm -rf $(SITE_DIR)/manual - mv manual/html $(SITE_DIR)/manual + mv info/html $(SITE_DIR)/manual diff --git a/docs/manual/.gitignore b/docs/info/.gitignore similarity index 100% rename from docs/manual/.gitignore rename to docs/info/.gitignore diff --git a/docs/manual/Makefile b/docs/info/Makefile similarity index 100% rename from docs/manual/Makefile rename to docs/info/Makefile diff --git a/docs/manual/_header.html b/docs/info/_header.html similarity index 100% rename from docs/manual/_header.html rename to docs/info/_header.html diff --git a/docs/manual/contribution-guide.texi b/docs/info/contribution-guide.texi similarity index 100% rename from docs/manual/contribution-guide.texi rename to docs/info/contribution-guide.texi diff --git a/docs/manual/getting-started.texi b/docs/info/getting-started.texi similarity index 100% rename from docs/manual/getting-started.texi rename to docs/info/getting-started.texi diff --git a/docs/manual/installation.texi b/docs/info/installation.texi similarity index 100% rename from docs/manual/installation.texi rename to docs/info/installation.texi diff --git a/docs/manual/introduction.texi b/docs/info/introduction.texi similarity index 100% rename from docs/manual/introduction.texi rename to docs/info/introduction.texi diff --git a/docs/manual/olang.texi b/docs/info/olang.texi similarity index 100% rename from docs/manual/olang.texi rename to docs/info/olang.texi diff --git a/docs/manual/specification.texi b/docs/info/specification.texi similarity index 99% rename from docs/manual/specification.texi rename to docs/info/specification.texi index e028fe9..df5c029 100644 --- a/docs/manual/specification.texi +++ b/docs/info/specification.texi @@ -1,4 +1,4 @@ -@node Specification +@node Language Specification @chapter Specification @section Introduction -- 2.46.0