public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
35f0283c7ac3432248f77a56fc9212df70ecdb2c blob 2103 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
 
.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-man install-info

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

.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: integration-test
integration-test:
	$(MAKE)
	$(MAKE) -C tests/integration/

.PHONY: unit-test
unit-test:
	$(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/integration/
	$(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 35f0283 ...
found 35f0283 in https://git.johnnyrichard.com/olang.git

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