Lindenii Project Forge
Login

scdoc

scdoc mirror for performance testing
Commit info
ID
a1b614bd62b6a2b1c0b2fc070a0d1632316804d1
Author
Drew DeVault <sir@cmpwn.com>
Author date
Sun, 10 Dec 2017 01:23:40 -0500
Committer
Drew DeVault <sir@cmpwn.com>
Committer date
Sun, 10 Dec 2017 01:23:40 -0500
Actions
Switch from meson to plain makefile
build
.build
scdoc
scdoc.1
Copyright © 2017 Drew DeVault

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
CC=cc
CFLAGS=-Wall -Wextra -Werror -Wno-unused-parameter
LDFLAGS=-static
INCLUDE=-Iinclude
PREFIX=/usr/local
DESTDIR=
_INSTDIR=$(DESTDIR)$(PREFIX)
BINDIR=$(_INSTDIR)/bin
MANDIR=$(_INSTDIR)/share/man
.DEFAULT_GOAL=all

OBJECTS=\
		.build/main.o \
		.build/string.o \
		.build/utf8_chsize.o \
		.build/utf8_decode.o \
		.build/utf8_encode.o \
		.build/utf8_fgetch.o \
		.build/utf8_fputch.o \
		.build/utf8_size.o \
		.build/util.o

.build/%.o: src/%.c
	@mkdir -p .build
	$(CC) -std=c99 -c -o $@ $(CFLAGS) $(INCLUDE) $<

scdoc: $(OBJECTS)
	$(CC) $(LDFLAGS) -o $@ $^

scdoc.1: scdoc.1.scd scdoc
	./scdoc < $< > $@

all: scdoc scdoc.1

clean:
	rm -rf .build scdoc

install: all
	mkdir -p $(DESTDIR)
	install -Dm755 scdoc $(BINDIR)/scdoc
	install -Dm644 scdoc.1 $(MANDIR)/scdoc.1

.PHONY: all clean install
# TODO: Just use a makefile
project(
	'scdoc',
	'c',
	license: 'MIT',
	meson_version: '>=0.43.0',
	default_options: [
		'c_std=c99',
		'warning_level=2',
		'werror=true',
	],
)

add_project_arguments('-Wno-unused-parameter', language: 'c')

executable(
	'scdoc', [
		'src/main.c',
		'src/string.c',
		'src/utf8_chsize.c',
		'src/utf8_decode.c',
		'src/utf8_encode.c',
		'src/utf8_fgetch.c',
		'src/utf8_fputch.c',
		'src/utf8_size.c',
		'src/util.c',
	],
	include_directories: include_directories('include')
)