-
Notifications
You must be signed in to change notification settings - Fork 267
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (42 loc) · 1.53 KB
/
Makefile
File metadata and controls
51 lines (42 loc) · 1.53 KB
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
# Copyright 2022-2025 Herb Sutter
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# Part of the Cppfront Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://github.com/hsutter/cppfront/blob/main/LICENSE for license information.
#
# This Makefile is strictly optional and is just a convenience for building cppfront.
# You can also build cppfront by running the cppfront.cpp source file through your
# C++ compiler in the normal manner.
all: cppfront.exe source/reflect.h include/cpp2regex.h
CXX ?= g++
CPPFRONT ?= ./cppfront.exe
CFLAGS ?=
REGRESS_LABEL ?= regress
REGRESS_STD ?= c++2b
CFLAGS += -Wall -Werror -Wextra -Wpedantic
ifeq (${DEBUG},1)
CFLAGS += -g
endif
ifeq (${RELEASE},1)
CFLAGS += -O3
endif
ifeq (${PROFILE},1)
CFLAGS += -pg
endif
ifeq (${SANITIZE},1)
CFLAGS += -fsanitize=address -fsanitize=undefined
endif
ifeq (${COVERAGE},1)
CFLAGS += --coverage
endif
cppfront.exe: source/cppfront.cpp source/common.h source/cpp2regex.h include/cpp2regex.h source/cpp2util.h include/cpp2util.h source/io.h source/lex.h source/parse.h source/reflect.h source/sema.h source/to_cpp1.h
${CXX} -std=c++20 -o cppfront.exe -Iinclude ${CFLAGS} source/cppfront.cpp
include/cpp2regex.h: include/cpp2regex.h2
${CPPFRONT} include/cpp2regex.h2 -o include/cpp2regex.h
source/reflect.h: source/reflect.h2
${CPPFRONT} source/reflect.h2 -o source/reflect.h
regress: cppfront.exe
cd regression-tests && \
bash ./run-tests.sh -e ../cppfront.exe -c ${CXX} -l ${REGRESS_LABEL} -s ${REGRESS_STD}
clean:
rm -f cppfront.exe