public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
83c88a27c32ee5285ee47fd6b555962d0645d9e4 blob 2301 bytes (raw)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
 
.POSIX:

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
MAN1DIR ?= ${MANDIR}/man1
SRCDIR := src
BUILDDIR := build

SRCS := $(wildcard $(SRCDIR)/*.c)
HEADERS := $(wildcard $(SRCDIR)/*.h)
OBJS := $(patsubst $(SRCDIR)/%.c, $(BUILDDIR)/%.o, $(SRCS))

.PHONY: all
all: $(TARGET)

.PHONY: info
info: olang.info

# install target

.PHONY: install
install: install-bin install-man install-info

.PHONY: install-bin
install-bin: $(TARGET)
	install -Dm755 $< ${DESTDIR}${BINDIR}/$<

.PHONY: install-man
install-man: install-man1

.PHONY: install-man1
install-man1: docs/man/man1/olang.1
	install -Dm 644 docs/man/man1/olang.1 ${DESTDIR}${MAN1DIR}/olang.1
	gzip -f ${DESTDIR}${MAN1DIR}/olang.1

.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-bin uninstall-man uninstall-info

.PHONY: uninstall-bin
uninstall-bin: ${DESTDIR}${BINDIR}/olang
	@rm -f ${DESTDIR}${BINDIR}/olang

.PHONY: uninstall-man
uninstall-man: uninstall-man1

.PHONY: uninstall-man1
uninstall-man1:
	@rm -f ${DESTDIR}${MAN1DIR}/olang.1.gz

.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)

$(BUILDDIR):
	@mkdir -p $@

.PHONY: format
format: $(SRCS) $(HEADERS)
	clang-format --dry-run --Werror $?
	$(MAKE) -C tests/unit/ format

.PHONY: format-fix
format-fix: $(SRCS) $(HEADERS)
	clang-format -i $?
	$(MAKE) -C tests/unit/ format-fix

.PHONY: check-execute
check-execute:
	$(MAKE)
	$(MAKE) -C tests/execute/

.PHONY: check-unit
check-unit:
	$(MAKE)
	$(MAKE) -C tests/unit/

.PHONY: clean
clean:
	@rm -f olang.info
	$(MAKE) -C tests/unit/ clean
	@rm -rf build/ $(TARGET)

.PHONY: check
check:
	$(MAKE)
	$(MAKE) -C tests/execute/
	$(MAKE) -C tests/unit/

.PHONY: docs
docs:
	$(MAKE) -C docs

.PHONY: docs-dist
docs-dist:
	$(MAKE) -C docs dist

$(BUILDDIR)/%.o: $(SRCDIR)/%.c
	$(CC) $(CFLAGS) -c $< -o $@
debug log:

solving 83c88a2 ...
found 83c88a2 in http://lists.johnnyrichard.com/olang/20240921210512.1100242-3-johnny@johnnyrichard.com/
found 2b65f96 in http://lists.johnnyrichard.com/olang/20240921210512.1100242-2-johnny@johnnyrichard.com/
found 12b09a4 in https://git.johnnyrichard.com/olang.git
preparing index
index prepared:
100644 12b09a44dbfe26cc0fd6ee0b01ff3a075eafefca	Makefile

applying [1/2] http://lists.johnnyrichard.com/olang/20240921210512.1100242-2-johnny@johnnyrichard.com/
diff --git a/Makefile b/Makefile
index 12b09a4..2b65f96 100644


applying [2/2] http://lists.johnnyrichard.com/olang/20240921210512.1100242-3-johnny@johnnyrichard.com/
diff --git a/Makefile b/Makefile
index 2b65f96..83c88a2 100644

Checking patch Makefile...
Applied patch Makefile cleanly.
Checking patch Makefile...
Applied patch Makefile cleanly.

index at:
100644 83c88a27c32ee5285ee47fd6b555962d0645d9e4	Makefile

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