-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (43 loc) · 977 Bytes
/
Makefile
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
# Copyright (c) 2019 Tuxera US Inc
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Makefile for mkssi-fast-export.
CC=cc
YACC=bison
LEX=flex
CFLAGS=-I. -O2 -march=native -Wall -Werror
# flex/bison generate functions that we don't use, don't warn about them
CFLAGS+=-Wno-unused-function
# needed so that strcasestr() is available
CFLAGS+=-D_GNU_SOURCE
OBJS=\
authors.o \
changeset.o \
export.o \
gram.o \
import.o \
lex.o \
lines.o \
main.o \
merge.o \
project.o \
rcs-binary.o \
rcs-keyword.o \
rcs-text.o \
rcs-number.o \
utils.o
HDRSRC=interfaces.h
HDRGEN=gram.h lex.h
HDR=$(HDRSRC) $(HDRGEN)
.PHONY: all clean
all: mkssi-fast-export
lex.c: lex.l $(HDRSRC)
$(LEX) --header-file=lex.h --outfile=$@ $<
gram.c: gram.y $(HDRSRC)
$(YACC) --defines=gram.h --output-file=$@ $<
%.o: %.c $(HDR)
$(CC) $(CFLAGS) -c -o $@ $<
mkssi-fast-export: lex.c gram.c $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS)
clean:
rm -f lex.c lex.h gram.c gram.h *.o mkssi-fast-export