aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: b56c1247e181489c5f9d283de408ebc8e36e0c01 (plain) (blame)
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
target = ordinal

CC = cc
LEX = flex
CFLAGS = \
	-Wall -Wextra -Wpedantic -Werror \
	-O3 -march=native -mtune=native -pipe
LFLAGS = -f
LDLIBS = -lfl

PREFIX = /usr/local
DPREFIX = ${DESTDIR}${PREFIX}

all: ${target}
${target}: lex.yy.c
	${CC} ${CFLAGS} ${LDLIBS} -o $@ $<

lex.yy.c: main.l
	${LEX} ${LFLAGS} $<

install:
	mkdir -p ${DPREFIX}/bin ${DPREFIX}/share/man/man1
	cp ${target} ${DPREFIX}/bin
	cp ${target}.1 ${DPREFIX}/share/man/man1

clean:
	rm -f ${target} lex.yy.c