From: Johnny Richard <johnny@johnnyrichard.com>
To: ~johnnyrichard/olang-devel@lists.sr.ht
Cc: Johnny Richard <johnny@johnnyrichard.com>
Subject: [PATCH olang v1 1/4] build: add install/uninstall targets for info docs
Date: Tue, 17 Sep 2024 14:46:15 +0200 [thread overview]
Message-ID: <20240917124716.184501-2-johnny@johnnyrichard.com> (raw)
In-Reply-To: <20240917124716.184501-1-johnny@johnnyrichard.com>
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
---
.gitignore | 1 +
Makefile | 60 +++++++++++++++----
docs/.gitignore | 1 +
docs/Makefile | 8 +--
docs/{manual => info}/.gitignore | 0
docs/{manual => info}/Makefile | 0
| 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
next prev parent reply other threads:[~2024-09-17 10:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-17 12:46 [PATCH olang v1 0/4] build: add install and uninstall targets Johnny Richard
2024-09-17 12:46 ` Johnny Richard [this message]
2024-09-17 12:46 ` [PATCH olang v1 2/4] build: add install/uninstall targets for man pages Johnny Richard
2024-09-17 12:46 ` [PATCH olang v1 3/4] build: add install/uninstall targets for olang bin Johnny Richard
2024-09-17 12:46 ` [PATCH olang v1 4/4] docs: info: add instructions to install/uninstall olang Johnny Richard
2024-09-17 10:48 ` [olang/patches/.build.yml] build success builds.sr.ht
2024-09-17 15:33 ` [PATCH olang v1 0/4] build: add install and uninstall targets Carlos Maniero
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240917124716.184501-2-johnny@johnnyrichard.com \
--to=johnny@johnnyrichard.com \
--cc=~johnnyrichard/olang-devel@lists.sr.ht \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.johnnyrichard.com/olang.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox