lol guess what... rewriting it in rust!!
This commit is contained in:
parent
179294a91a
commit
95ee020c37
@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
BasedOnStyle: Microsoft
|
|
||||||
AlignAfterOpenBracket: Align
|
|
||||||
AllowShortIfStatementsOnASingleLine: Always
|
|
||||||
AllowShortLambdasOnASingleLine: All
|
|
||||||
AllowShortLoopsOnASingleLine: 'true'
|
|
||||||
PointerAlignment: Left
|
|
||||||
SpaceAfterCStyleCast: 'false'
|
|
||||||
SpaceAfterTemplateKeyword: 'false'
|
|
||||||
SpacesInCStyleCastParentheses: 'false'
|
|
||||||
SpacesInSquareBrackets: 'false'
|
|
||||||
TabWidth: '4'
|
|
||||||
UseTab: Never
|
|
||||||
|
|
||||||
...
|
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,3 +1,7 @@
|
|||||||
build/
|
build/
|
||||||
.vscode
|
.vscode
|
||||||
.cache
|
.cache
|
||||||
|
|
||||||
|
# Added by cargo
|
||||||
|
|
||||||
|
target
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
|||||||
[submodule "external/doxygen-awesome-css"]
|
|
||||||
path = external/doxygen-awesome-css
|
|
||||||
url = https://github.com/jothepro/doxygen-awesome-css.git
|
|
@ -1,91 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.18...3.22)
|
|
||||||
project(sapphire-compiler LANGUAGES CXX C)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
|
|
||||||
find_package(LLVM REQUIRED CONFIG)
|
|
||||||
|
|
||||||
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
|
|
||||||
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
|
|
||||||
|
|
||||||
include_directories(${LLVM_INCLUDE_DIRS})
|
|
||||||
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
|
|
||||||
add_definitions(${LLVM_DEFINITIONS_LIST})
|
|
||||||
|
|
||||||
add_executable(
|
|
||||||
sapphirec
|
|
||||||
src/sapphire.cpp
|
|
||||||
src/Lexer.cpp
|
|
||||||
src/Lexer.h
|
|
||||||
src/Token.h
|
|
||||||
src/Token.cpp
|
|
||||||
src/Location.h
|
|
||||||
src/Location.cpp
|
|
||||||
src/Error.h
|
|
||||||
src/Error.cpp
|
|
||||||
src/external/FormatString/FormatString.hpp
|
|
||||||
src/FileIO.h
|
|
||||||
src/FileIO.cpp
|
|
||||||
src/Arguments.cpp
|
|
||||||
src/Arguments.h
|
|
||||||
src/AST/ASTNode.cpp
|
|
||||||
src/AST/ASTNode.h
|
|
||||||
src/AST/BinaryOpNode.cpp
|
|
||||||
src/AST/BinaryOpNode.h
|
|
||||||
src/AST/ExprNode.cpp
|
|
||||||
src/AST/ExprNode.h
|
|
||||||
src/AST/MulNode.cpp
|
|
||||||
src/AST/MulNode.h
|
|
||||||
src/AST/StatementNode.cpp
|
|
||||||
src/AST/StatementNode.h
|
|
||||||
src/AST/NumberNode.cpp
|
|
||||||
src/AST/NumberNode.h
|
|
||||||
src/AST/SumNode.cpp
|
|
||||||
src/AST/SumNode.h
|
|
||||||
src/AST/SyscallNode.cpp
|
|
||||||
src/AST/SyscallNode.h
|
|
||||||
src/AST/UnaryOpNode.cpp
|
|
||||||
src/AST/UnaryOpNode.h
|
|
||||||
src/AST/ProgramNode.cpp
|
|
||||||
src/AST/ProgramNode.h
|
|
||||||
src/AST/TopLevelNode.cpp
|
|
||||||
src/AST/TopLevelNode.h
|
|
||||||
src/AST/FunctionPrototype.cpp
|
|
||||||
src/AST/FunctionPrototype.h
|
|
||||||
src/AST/FunctionNode.cpp
|
|
||||||
src/AST/FunctionNode.h
|
|
||||||
src/AST/EmptyFunctionNode.cpp
|
|
||||||
src/AST/EmptyFunctionNode.h
|
|
||||||
src/GlobalContext.cpp
|
|
||||||
src/GlobalContext.h
|
|
||||||
src/utils.cpp
|
|
||||||
src/utils.h
|
|
||||||
src/Parser.cpp
|
|
||||||
src/Parser.h
|
|
||||||
src/sapphirepch.h
|
|
||||||
src/IRBuilder.cpp
|
|
||||||
src/IRBuilder.h
|
|
||||||
src/Result.h
|
|
||||||
)
|
|
||||||
|
|
||||||
target_include_directories(sapphirec PUBLIC src)
|
|
||||||
target_include_directories(sapphirec PUBLIC src/external/tclap-1.2.5/include)
|
|
||||||
target_include_directories(sapphirec PUBLIC src/external)
|
|
||||||
target_precompile_headers(sapphirec PUBLIC src/sapphirepch.h)
|
|
||||||
set_property(TARGET sapphirec PROPERTY COMPILE_WARNING_AS_ERROR ON)
|
|
||||||
|
|
||||||
target_compile_options(sapphirec PRIVATE
|
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:/W4>
|
|
||||||
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic>
|
|
||||||
)
|
|
||||||
|
|
||||||
llvm_map_components_to_libnames(llvm_libs all core support irreader x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils)
|
|
||||||
|
|
||||||
target_link_libraries(sapphirec ${llvm_libs})
|
|
||||||
|
|
||||||
install(TARGETS sapphirec)
|
|
||||||
|
|
||||||
include_directories(src src/tclap-1.2.5/include)
|
|
||||||
|
|
||||||
include(cmake/clang-dev-tools.cmake)
|
|
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sapphire"
|
||||||
|
version = "0.1.0"
|
8
Cargo.toml
Normal file
8
Cargo.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[package]
|
||||||
|
name = "sapphire"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
@ -1,9 +0,0 @@
|
|||||||
file(GLOB ALL_SOURCE_FILES src/*.cpp src/*.h src/AST/*.cpp src/AST/*.h)
|
|
||||||
|
|
||||||
add_custom_target(
|
|
||||||
clang-format
|
|
||||||
COMMAND /usr/bin/clang-format
|
|
||||||
-style=file
|
|
||||||
-i
|
|
||||||
${ALL_SOURCE_FILES}
|
|
||||||
)
|
|
@ -1,4 +0,0 @@
|
|||||||
.vscode/**
|
|
||||||
.vscode-test/**
|
|
||||||
.gitignore
|
|
||||||
vsc-extension-quickstart.md
|
|
@ -1,9 +0,0 @@
|
|||||||
# Change Log
|
|
||||||
|
|
||||||
All notable changes to the "sapphirelang" extension will be documented in this file.
|
|
||||||
|
|
||||||
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
|
|
||||||
|
|
||||||
## [Unreleased]
|
|
||||||
|
|
||||||
- Initial release
|
|
@ -1,65 +0,0 @@
|
|||||||
# sapphirelang README
|
|
||||||
|
|
||||||
This is the README for your extension "sapphirelang". After writing up a brief description, we recommend including the following sections.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
|
|
||||||
|
|
||||||
For example if there is an image subfolder under your extension project workspace:
|
|
||||||
|
|
||||||
\!\[feature X\]\(images/feature-x.png\)
|
|
||||||
|
|
||||||
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
|
|
||||||
|
|
||||||
## Extension Settings
|
|
||||||
|
|
||||||
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
|
|
||||||
This extension contributes the following settings:
|
|
||||||
|
|
||||||
* `myExtension.enable`: enable/disable this extension
|
|
||||||
* `myExtension.thing`: set to `blah` to do something
|
|
||||||
|
|
||||||
## Known Issues
|
|
||||||
|
|
||||||
Calling out known issues can help limit users opening duplicate issues against your extension.
|
|
||||||
|
|
||||||
## Release Notes
|
|
||||||
|
|
||||||
Users appreciate release notes as you update your extension.
|
|
||||||
|
|
||||||
### 1.0.0
|
|
||||||
|
|
||||||
Initial release of ...
|
|
||||||
|
|
||||||
### 1.0.1
|
|
||||||
|
|
||||||
Fixed issue #.
|
|
||||||
|
|
||||||
### 1.1.0
|
|
||||||
|
|
||||||
Added features X, Y, and Z.
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
## Working with Markdown
|
|
||||||
|
|
||||||
**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
|
|
||||||
|
|
||||||
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
|
|
||||||
* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
|
|
||||||
* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets
|
|
||||||
|
|
||||||
### For more information
|
|
||||||
|
|
||||||
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
|
|
||||||
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
|
|
||||||
|
|
||||||
**Enjoy!**
|
|
@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"comments": {
|
|
||||||
// symbol used for single line comment. Remove this entry if your language does not support line comments
|
|
||||||
"lineComment": "//"
|
|
||||||
},
|
|
||||||
// symbols used as brackets
|
|
||||||
"brackets": [
|
|
||||||
["{", "}"],
|
|
||||||
["(", ")"]
|
|
||||||
],
|
|
||||||
// symbols that are auto closed when typing
|
|
||||||
"autoClosingPairs": [
|
|
||||||
["{", "}"],
|
|
||||||
["(", ")"],
|
|
||||||
["'", "'"]
|
|
||||||
],
|
|
||||||
// symbols that can be used to surround a selection
|
|
||||||
"surroundingPairs": [
|
|
||||||
["{", "}"],
|
|
||||||
["(", ")"],
|
|
||||||
["'", "'"]
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "sapphirelang",
|
|
||||||
"displayName": "SapphireLang",
|
|
||||||
"description": "Syntax support for Sapphire",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"engines": {
|
|
||||||
"vscode": "^1.64.0"
|
|
||||||
},
|
|
||||||
"categories": [
|
|
||||||
"Programming Languages"
|
|
||||||
],
|
|
||||||
"contributes": {
|
|
||||||
"languages": [{
|
|
||||||
"id": "sapphire",
|
|
||||||
"aliases": ["Sapphire", "sapphire"],
|
|
||||||
"extensions": [".sp"],
|
|
||||||
"configuration": "./language-configuration.json"
|
|
||||||
}],
|
|
||||||
"grammars": [{
|
|
||||||
"language": "sapphire",
|
|
||||||
"scopeName": "source.sp",
|
|
||||||
"path": "./syntaxes/sapphire.tmLanguage.json"
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
||||||
"name": "Sapphire",
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"include": "#keywords"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"include": "#strings"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"include": "#comments"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"include": "#types"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"include": "#functions"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"include": "#variables"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"repository": {
|
|
||||||
"keywords": {
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"name": "keyword.control.sapphire",
|
|
||||||
"match": "\\b(let|in|syscall0|syscall1|syscall2|syscall3|syscall4|syscall5)\\b"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"types": {
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"name": "entity.name.type",
|
|
||||||
"match": "\\b(u8|u16|u32|u64|i8|i16|i32|i64|ptr8|ptr16|ptr32|ptr64|str|void)\\b"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"strings": {
|
|
||||||
"name": "string.quoted.sapphire",
|
|
||||||
"begin": "'",
|
|
||||||
"end": "'",
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"name": "constant.character.escape.sapphire",
|
|
||||||
"match": "\\\\."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"comments": {
|
|
||||||
"name": "comment.line",
|
|
||||||
"begin": "//",
|
|
||||||
"end": "\n"
|
|
||||||
},
|
|
||||||
"functions": {
|
|
||||||
"name": "support.function",
|
|
||||||
"begin": "@",
|
|
||||||
"end": "\\b(in|;)\\b"
|
|
||||||
},
|
|
||||||
"variables": {
|
|
||||||
"name": "variable.name",
|
|
||||||
"match": "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"scopeName": "source.sp"
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
# Welcome to your VS Code Extension
|
|
||||||
|
|
||||||
## What's in the folder
|
|
||||||
|
|
||||||
* This folder contains all of the files necessary for your extension.
|
|
||||||
* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension.
|
|
||||||
* `syntaxes/sapphire.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization.
|
|
||||||
* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets.
|
|
||||||
|
|
||||||
## Get up and running straight away
|
|
||||||
|
|
||||||
* Make sure the language configuration settings in `language-configuration.json` are accurate.
|
|
||||||
* Press `F5` to open a new window with your extension loaded.
|
|
||||||
* Create a new file with a file name suffix matching your language.
|
|
||||||
* Verify that syntax highlighting works and that the language configuration settings are working.
|
|
||||||
|
|
||||||
## Make changes
|
|
||||||
|
|
||||||
* You can relaunch the extension from the debug toolbar after making changes to the files listed above.
|
|
||||||
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
|
|
||||||
|
|
||||||
## Add more language features
|
|
||||||
|
|
||||||
* To add features such as intellisense, hovers and validators check out the VS Code extenders documentation at https://code.visualstudio.com/docs
|
|
||||||
|
|
||||||
## Install your extension
|
|
||||||
|
|
||||||
* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code.
|
|
||||||
* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.
|
|
@ -1,5 +0,0 @@
|
|||||||
const { exit } from @'core/os';
|
|
||||||
|
|
||||||
let @main : i32 in {
|
|
||||||
exit(1);
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
const io from @'core/io';
|
|
||||||
const { open } from @'core/fs';
|
|
||||||
|
|
||||||
let @main : i32 in {
|
|
||||||
io.out('What is your name? ');
|
|
||||||
let name = io.in();
|
|
||||||
let file = open('name.txt');
|
|
||||||
file.write(name);
|
|
||||||
file.close();
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
const io from @'core/io';
|
|
||||||
const { concat } from @'core/string';
|
|
||||||
const { toString } from @'core/float_utils';
|
|
||||||
|
|
||||||
let @main : i32 in {
|
|
||||||
let float1 : f128 = 234.6;
|
|
||||||
f128 float2 : f128 = 2934748348291930404.5;
|
|
||||||
io.outln(concat('Result is: ',toString(float1 + float2)));
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
const io from @'core/io';
|
|
||||||
|
|
||||||
let @main : i32 in {
|
|
||||||
io.outln('Hello world!');
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
const io from @'core/io';
|
|
||||||
|
|
||||||
let @main : i32 in {
|
|
||||||
io.out('What\'s your name? ');
|
|
||||||
let name = io.in();
|
|
||||||
io.out('Hello, ');
|
|
||||||
io.out(name);
|
|
||||||
io.out('!!');
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
const { io } from @'core/io';
|
|
||||||
|
|
||||||
const good_food : String = 'watermelon';
|
|
||||||
|
|
||||||
let @main : i32 in {
|
|
||||||
|
|
||||||
io.outln('Hello world!');
|
|
||||||
|
|
||||||
io.outf('My favorite food is %s\n',good_food);
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
2 2 6+
|
|
@ -1,8 +0,0 @@
|
|||||||
const io from @'core/io';
|
|
||||||
|
|
||||||
let @main : i32 in {
|
|
||||||
let age : i32 = 64;
|
|
||||||
io.out('I am ');
|
|
||||||
io.out(age);
|
|
||||||
io.outln(' years old.');
|
|
||||||
}
|
|
25
sapphire.sh
25
sapphire.sh
@ -1,25 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
cd $(dirname $0)
|
|
||||||
|
|
||||||
usage()
|
|
||||||
{
|
|
||||||
echo "Sapphire utility script"
|
|
||||||
echo "-----------------------"
|
|
||||||
echo "sapphire.sh build <config>: build the project"
|
|
||||||
echo "sapphire.sh generate <generator> <config>: regenerate build files"
|
|
||||||
echo "sapphire.sh format: run clang-format on source files"
|
|
||||||
echo "sapphire.sh clean: clean build files"
|
|
||||||
echo "sapphire.sh install <path>: install the project"
|
|
||||||
echo "sapphire.sh new-ast-node <name>: create a new AST node"
|
|
||||||
}
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
"build") tools/build.sh "$2";;
|
|
||||||
"generate") tools/generate.sh "$2" "$3";;
|
|
||||||
"format") tools/format.sh;;
|
|
||||||
"clean") rm -rf build;;
|
|
||||||
"install") tools/install.sh "$2";;
|
|
||||||
"new-ast-node") tools/generateASTNode.sh $2;;
|
|
||||||
"help") usage;;
|
|
||||||
*) echo "Invalid action, run './sapphire.sh help' for a list of available options.";;
|
|
||||||
esac
|
|
@ -1,9 +0,0 @@
|
|||||||
#include "ASTNode.h"
|
|
||||||
|
|
||||||
ASTNode::ASTNode()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ASTNode::~ASTNode()
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "llvm/IR/Value.h"
|
|
||||||
|
|
||||||
class IRBuilder;
|
|
||||||
|
|
||||||
class ASTNode
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ASTNode();
|
|
||||||
~ASTNode();
|
|
||||||
|
|
||||||
virtual llvm::Value* codegen(IRBuilder* generator) = 0;
|
|
||||||
};
|
|
@ -1,10 +0,0 @@
|
|||||||
#include "BinaryOpNode.h"
|
|
||||||
|
|
||||||
BinaryOpNode::BinaryOpNode(std::shared_ptr<ExprNode> left, std::shared_ptr<ExprNode> right)
|
|
||||||
: ExprNode(), left(left), right(right)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
BinaryOpNode::~BinaryOpNode()
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "ExprNode.h"
|
|
||||||
|
|
||||||
class BinaryOpNode : public ExprNode
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
std::shared_ptr<ExprNode> left;
|
|
||||||
std::shared_ptr<ExprNode> right;
|
|
||||||
|
|
||||||
public:
|
|
||||||
BinaryOpNode(std::shared_ptr<ExprNode> left, std::shared_ptr<ExprNode> right);
|
|
||||||
~BinaryOpNode();
|
|
||||||
};
|
|
@ -1,27 +0,0 @@
|
|||||||
#include "EmptyFunctionNode.h"
|
|
||||||
#include "../Error.h"
|
|
||||||
#include "../utils.h"
|
|
||||||
|
|
||||||
EmptyFunctionNode::EmptyFunctionNode(FunctionPrototype prototype) : TopLevelNode(), prototype(prototype)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void EmptyFunctionNode::codegen([[maybe_unused]] IRBuilder* generator, llvm::Module* module)
|
|
||||||
{
|
|
||||||
llvm::Function* Function = module->getFunction(prototype.name);
|
|
||||||
if (!Function)
|
|
||||||
{
|
|
||||||
llvm::FunctionType* Type = prototype.toFunctionType();
|
|
||||||
|
|
||||||
Function = llvm::Function::Create(Type, llvm::Function::ExternalLinkage, prototype.name, *module);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!equals(Function->getFunctionType(), prototype.toFunctionType()))
|
|
||||||
{
|
|
||||||
// FIXME: add location information to AST nodes, to add information to these errors
|
|
||||||
Error::throw_error_without_location(
|
|
||||||
format_string("Function %s redefined with different prototype", prototype.name.c_str()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "../IRBuilder.h"
|
|
||||||
#include "FunctionPrototype.h"
|
|
||||||
#include "TopLevelNode.h"
|
|
||||||
|
|
||||||
class EmptyFunctionNode final : public TopLevelNode
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
FunctionPrototype prototype;
|
|
||||||
|
|
||||||
public:
|
|
||||||
EmptyFunctionNode(FunctionPrototype prototype);
|
|
||||||
~EmptyFunctionNode() = default;
|
|
||||||
|
|
||||||
void codegen(IRBuilder* generator, llvm::Module* module) override;
|
|
||||||
};
|
|
@ -1,13 +0,0 @@
|
|||||||
#include "ExprNode.h"
|
|
||||||
|
|
||||||
ExprNode::ExprNode(std::shared_ptr<ExprNode> child) : ASTNode(), child(child)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ExprNode::ExprNode() : ASTNode()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
ExprNode::~ExprNode()
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "ASTNode.h"
|
|
||||||
|
|
||||||
class ExprNode : public ASTNode
|
|
||||||
{
|
|
||||||
std::shared_ptr<ExprNode> child;
|
|
||||||
|
|
||||||
public:
|
|
||||||
ExprNode(std::shared_ptr<ExprNode> child);
|
|
||||||
ExprNode();
|
|
||||||
~ExprNode();
|
|
||||||
};
|
|
@ -1,78 +0,0 @@
|
|||||||
#include "FunctionNode.h"
|
|
||||||
#include "../Error.h"
|
|
||||||
#include "../IRBuilder.h"
|
|
||||||
#include "../utils.h"
|
|
||||||
#include "llvm/IR/Verifier.h"
|
|
||||||
|
|
||||||
FunctionNode::FunctionNode(FunctionPrototype prototype, std::shared_ptr<ExprNode> body)
|
|
||||||
: prototype(prototype), body(body)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void FunctionNode::codegen(IRBuilder* builder, llvm::Module* module)
|
|
||||||
{
|
|
||||||
llvm::Function* Function = module->getFunction(prototype.name);
|
|
||||||
if (!Function)
|
|
||||||
{
|
|
||||||
llvm::FunctionType* Type = prototype.toFunctionType();
|
|
||||||
|
|
||||||
Function = llvm::Function::Create(Type, llvm::Function::ExternalLinkage, prototype.name, *module);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!equals(Function->getFunctionType(), prototype.toFunctionType()))
|
|
||||||
{
|
|
||||||
// FIXME: add location information to AST nodes, to add information to these errors
|
|
||||||
Error::throw_error_without_location(
|
|
||||||
format_string("Function %s redefined with different prototype", prototype.name.c_str()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Function) return;
|
|
||||||
|
|
||||||
if (!Function->empty())
|
|
||||||
{
|
|
||||||
Error::throw_error_without_location(format_string("Function %s already has a body", prototype.name.c_str()));
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::BasicBlock* BB = llvm::BasicBlock::Create(builder->getBuilder()->getContext(), "entry", Function);
|
|
||||||
builder->getBuilder()->SetInsertPoint(BB);
|
|
||||||
|
|
||||||
if (llvm::Value* retVal = body->codegen(builder))
|
|
||||||
{
|
|
||||||
if (retVal->getType() != prototype.returnType)
|
|
||||||
{
|
|
||||||
if (retVal->getType()->isIntegerTy() && prototype.returnType->isIntegerTy())
|
|
||||||
{
|
|
||||||
retVal = builder->getBuilder()->CreateIntCast(retVal, prototype.returnType, true);
|
|
||||||
}
|
|
||||||
else if (retVal->getType()->isFloatingPointTy() && prototype.returnType->isFloatingPointTy())
|
|
||||||
{
|
|
||||||
retVal = builder->getBuilder()->CreateFPCast(retVal, prototype.returnType);
|
|
||||||
}
|
|
||||||
else if (retVal->getType()->isIntegerTy() && prototype.returnType->isFloatingPointTy())
|
|
||||||
{
|
|
||||||
retVal = builder->getBuilder()->CreateCast(llvm::Instruction::SIToFP, retVal, prototype.returnType);
|
|
||||||
}
|
|
||||||
else if (retVal->getType()->isFloatingPointTy() && prototype.returnType->isIntegerTy())
|
|
||||||
{
|
|
||||||
retVal = builder->getBuilder()->CreateCast(llvm::Instruction::FPToSI, retVal, prototype.returnType);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Error::throw_error_without_location(
|
|
||||||
format_string("The %s function's body type does not match its return type", prototype.name));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
builder->getBuilder()->CreateRet(retVal);
|
|
||||||
|
|
||||||
if (llvm::verifyFunction(*Function))
|
|
||||||
{
|
|
||||||
Error::throw_error_without_location(format_string("Invalid function %s", prototype.name.c_str()));
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Function->eraseFromParent();
|
|
||||||
Error::throw_error_without_location(format_string("Error generating code of function %s", prototype.name.c_str()));
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "ExprNode.h"
|
|
||||||
#include "FunctionPrototype.h"
|
|
||||||
#include "TopLevelNode.h"
|
|
||||||
|
|
||||||
class FunctionNode final : public TopLevelNode
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
FunctionPrototype prototype;
|
|
||||||
std::shared_ptr<ExprNode> body;
|
|
||||||
|
|
||||||
public:
|
|
||||||
FunctionNode(FunctionPrototype prototype, std::shared_ptr<ExprNode> body);
|
|
||||||
~FunctionNode() = default;
|
|
||||||
|
|
||||||
void codegen(IRBuilder* builder, llvm::Module* module) override;
|
|
||||||
};
|
|
@ -1,18 +0,0 @@
|
|||||||
#include "FunctionPrototype.h"
|
|
||||||
|
|
||||||
llvm::FunctionType* FunctionPrototype::toFunctionType()
|
|
||||||
{
|
|
||||||
if (arguments.size() == 0)
|
|
||||||
{
|
|
||||||
return llvm::FunctionType::get(returnType, false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::vector<llvm::Type*> args;
|
|
||||||
for (auto& item : arguments)
|
|
||||||
{
|
|
||||||
args.push_back(item.first);
|
|
||||||
}
|
|
||||||
return llvm::FunctionType::get(returnType, args, false);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "llvm/IR/Function.h"
|
|
||||||
#include "llvm/IR/Type.h"
|
|
||||||
|
|
||||||
struct FunctionPrototype
|
|
||||||
{
|
|
||||||
llvm::Type* returnType;
|
|
||||||
std::string name;
|
|
||||||
std::vector<std::pair<llvm::Type*, std::string>> arguments;
|
|
||||||
|
|
||||||
llvm::FunctionType* toFunctionType();
|
|
||||||
};
|
|
@ -1,29 +0,0 @@
|
|||||||
#include "MulNode.h"
|
|
||||||
#include "../IRBuilder.h"
|
|
||||||
#include "../Error.h"
|
|
||||||
|
|
||||||
MulNode::MulNode(std::shared_ptr<ExprNode> left, std::shared_ptr<ExprNode> right, char op)
|
|
||||||
: BinaryOpNode(left, right), op(op)
|
|
||||||
{
|
|
||||||
if(op != '*' && op != '/')
|
|
||||||
{
|
|
||||||
Error::throw_error(CURRENT_LOCATION, "BUG: MulNode expects op to be either * or /");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MulNode::~MulNode()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::Value* MulNode::codegen(IRBuilder* generator)
|
|
||||||
{
|
|
||||||
switch (op)
|
|
||||||
{
|
|
||||||
case '*':
|
|
||||||
return generator->getBuilder()->CreateMul(left->codegen(generator), right->codegen(generator));
|
|
||||||
case '/':
|
|
||||||
return generator->getBuilder()->CreateSDiv(left->codegen(generator), right->codegen(generator));
|
|
||||||
default:
|
|
||||||
__builtin_unreachable();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "BinaryOpNode.h"
|
|
||||||
|
|
||||||
class MulNode final : public BinaryOpNode
|
|
||||||
{
|
|
||||||
char op;
|
|
||||||
|
|
||||||
public:
|
|
||||||
MulNode(std::shared_ptr<ExprNode> left, std::shared_ptr<ExprNode> right, char op);
|
|
||||||
~MulNode();
|
|
||||||
|
|
||||||
llvm::Value* codegen(IRBuilder* generator) override;
|
|
||||||
};
|
|
@ -1,9 +0,0 @@
|
|||||||
#include "NumberNode.h"
|
|
||||||
|
|
||||||
NumberNode::NumberNode()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
NumberNode::~NumberNode()
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "../IRBuilder.h"
|
|
||||||
#include "ExprNode.h"
|
|
||||||
#include "llvm/IR/Constant.h"
|
|
||||||
#include "llvm/IR/Type.h"
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
class NumberNode : public ExprNode
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
NumberNode();
|
|
||||||
~NumberNode();
|
|
||||||
|
|
||||||
virtual bool is_floating()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
virtual bool is_integral()
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T> class BasicNumberNode : public NumberNode
|
|
||||||
{
|
|
||||||
T value;
|
|
||||||
|
|
||||||
public:
|
|
||||||
BasicNumberNode(T value) : value(value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
~BasicNumberNode()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr bool is_floating() override
|
|
||||||
{
|
|
||||||
return std::is_floating_point<T>::value;
|
|
||||||
}
|
|
||||||
|
|
||||||
constexpr bool is_integral() override
|
|
||||||
{
|
|
||||||
return std::is_integral<T>::value;
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::Value* codegen(IRBuilder* generator) override
|
|
||||||
{
|
|
||||||
if (is_integral())
|
|
||||||
{
|
|
||||||
return llvm::ConstantInt::getSigned(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()),
|
|
||||||
value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return llvm::ConstantFP::get(llvm::Type::getFloatTy(generator->getBuilder()->getContext()), value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
using IntegerNode = BasicNumberNode<int>;
|
|
||||||
using FloatNode = BasicNumberNode<float>;
|
|
@ -1,18 +0,0 @@
|
|||||||
#include "ProgramNode.h"
|
|
||||||
|
|
||||||
ProgramNode::ProgramNode() : TopLevelNode()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProgramNode::append(std::shared_ptr<TopLevelNode> item)
|
|
||||||
{
|
|
||||||
program.push_back(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProgramNode::walk(std::function<void(std::shared_ptr<TopLevelNode>)> callback)
|
|
||||||
{
|
|
||||||
for (auto& item : program)
|
|
||||||
{
|
|
||||||
callback(item);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "TopLevelNode.h"
|
|
||||||
|
|
||||||
class ProgramNode final : public TopLevelNode
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
std::vector<std::shared_ptr<TopLevelNode>> program;
|
|
||||||
|
|
||||||
public:
|
|
||||||
ProgramNode();
|
|
||||||
~ProgramNode() = default;
|
|
||||||
|
|
||||||
void append(std::shared_ptr<TopLevelNode>);
|
|
||||||
|
|
||||||
void walk(std::function<void(std::shared_ptr<TopLevelNode>)> callback);
|
|
||||||
};
|
|
@ -1,9 +0,0 @@
|
|||||||
#include "StatementNode.h"
|
|
||||||
|
|
||||||
StatementNode::StatementNode(std::shared_ptr<ExprNode> child) : ASTNode(), child(child)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
StatementNode::~StatementNode()
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "ExprNode.h"
|
|
||||||
|
|
||||||
class StatementNode : public ASTNode
|
|
||||||
{
|
|
||||||
std::shared_ptr<ExprNode> child;
|
|
||||||
|
|
||||||
public:
|
|
||||||
StatementNode(std::shared_ptr<ExprNode> child);
|
|
||||||
~StatementNode();
|
|
||||||
};
|
|
@ -1,29 +0,0 @@
|
|||||||
#include "SumNode.h"
|
|
||||||
#include "../IRBuilder.h"
|
|
||||||
#include "../Error.h"
|
|
||||||
|
|
||||||
SumNode::SumNode(std::shared_ptr<ExprNode> left, std::shared_ptr<ExprNode> right, char op)
|
|
||||||
: BinaryOpNode(left, right), op(op)
|
|
||||||
{
|
|
||||||
if(op != '+' && op != '-')
|
|
||||||
{
|
|
||||||
Error::throw_error(CURRENT_LOCATION, "BUG: SumNode expects op to be either + or -");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SumNode::~SumNode()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::Value* SumNode::codegen(IRBuilder* generator)
|
|
||||||
{
|
|
||||||
switch (op)
|
|
||||||
{
|
|
||||||
case '+':
|
|
||||||
return generator->getBuilder()->CreateAdd(left->codegen(generator), right->codegen(generator));
|
|
||||||
case '-':
|
|
||||||
return generator->getBuilder()->CreateSub(left->codegen(generator), right->codegen(generator));
|
|
||||||
default:
|
|
||||||
__builtin_unreachable();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "BinaryOpNode.h"
|
|
||||||
|
|
||||||
class SumNode final : public BinaryOpNode
|
|
||||||
{
|
|
||||||
char op;
|
|
||||||
|
|
||||||
public:
|
|
||||||
SumNode(std::shared_ptr<ExprNode> left, std::shared_ptr<ExprNode> right, char op);
|
|
||||||
~SumNode();
|
|
||||||
|
|
||||||
llvm::Value* codegen(IRBuilder* generator) override;
|
|
||||||
};
|
|
@ -1,263 +0,0 @@
|
|||||||
#include "SyscallNode.h"
|
|
||||||
#include "../Arguments.h"
|
|
||||||
#include "../Error.h"
|
|
||||||
#include "../IRBuilder.h"
|
|
||||||
#include "llvm/IR/Function.h"
|
|
||||||
#include "llvm/IR/InlineAsm.h"
|
|
||||||
|
|
||||||
// FIXME: This API is HIGHLY Linux-specific. The right thing to be done should be to expose an inline assembly expression, to do this kind of stuff freely
|
|
||||||
// depending on the platform in core and any project that wants to use inline assembly, such as an OS kernel or embedded program :^)
|
|
||||||
|
|
||||||
Syscall0Node::Syscall0Node(int syscall_number) : ExprNode(), sys_num(syscall_number)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Syscall0Node::~Syscall0Node()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Syscall1Node::Syscall1Node(int syscall_number, std::shared_ptr<ASTNode> arg1)
|
|
||||||
: ExprNode(), sys_num(syscall_number), arg1(arg1)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Syscall1Node::~Syscall1Node()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Syscall2Node::Syscall2Node(int syscall_number, std::shared_ptr<ASTNode> arg1, std::shared_ptr<ASTNode> arg2)
|
|
||||||
: ExprNode(), sys_num(syscall_number), arg1(arg1), arg2(arg2)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Syscall2Node::~Syscall2Node()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Syscall3Node::Syscall3Node(int syscall_number, std::shared_ptr<ASTNode> arg1, std::shared_ptr<ASTNode> arg2,
|
|
||||||
std::shared_ptr<ASTNode> arg3)
|
|
||||||
: ExprNode(), sys_num(syscall_number), arg1(arg1), arg2(arg2), arg3(arg3)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Syscall3Node::~Syscall3Node()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Syscall4Node::Syscall4Node(int syscall_number, std::shared_ptr<ASTNode> arg1, std::shared_ptr<ASTNode> arg2,
|
|
||||||
std::shared_ptr<ASTNode> arg3, std::shared_ptr<ASTNode> arg4)
|
|
||||||
: ExprNode(), sys_num(syscall_number), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Syscall4Node::~Syscall4Node()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Syscall5Node::Syscall5Node(int syscall_number, std::shared_ptr<ASTNode> arg1, std::shared_ptr<ASTNode> arg2,
|
|
||||||
std::shared_ptr<ASTNode> arg3, std::shared_ptr<ASTNode> arg4, std::shared_ptr<ASTNode> arg5)
|
|
||||||
: ExprNode(), sys_num(syscall_number), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Syscall5Node::~Syscall5Node()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::Value* Syscall0Node::codegen(IRBuilder* generator)
|
|
||||||
{
|
|
||||||
switch (Arguments::TargetTriple.getArch())
|
|
||||||
{
|
|
||||||
case llvm::Triple::x86_64: {
|
|
||||||
auto i64Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt64Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i64Type, "syscall", "=r,{rax}", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case llvm::Triple::x86: {
|
|
||||||
auto i32Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i32Type, "int $2", "=r,{eax},i", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num),
|
|
||||||
llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), 0x80)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
Error::throw_error_without_location(
|
|
||||||
std::string("Unsupported arch for syscalls: ") +
|
|
||||||
Arguments::TargetTriple.getArchName(Arguments::TargetTriple.getArch()).str());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::Value* Syscall1Node::codegen(IRBuilder* generator)
|
|
||||||
{
|
|
||||||
switch (Arguments::TargetTriple.getArch())
|
|
||||||
{
|
|
||||||
case llvm::Triple::x86_64: {
|
|
||||||
auto i64Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt64Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i64Type, "syscall", "=r,{rax},{rdi}", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num),
|
|
||||||
arg1->codegen(generator)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case llvm::Triple::x86: {
|
|
||||||
auto i32Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i32Type, "int $2", "=r,{eax},i,{ebx}", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num),
|
|
||||||
llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), 0x80),
|
|
||||||
arg1->codegen(generator)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
Error::throw_error_without_location(
|
|
||||||
std::string("Unsupported arch for syscalls: ") +
|
|
||||||
Arguments::TargetTriple.getArchName(Arguments::TargetTriple.getArch()).str());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::Value* Syscall2Node::codegen(IRBuilder* generator)
|
|
||||||
{
|
|
||||||
switch (Arguments::TargetTriple.getArch())
|
|
||||||
{
|
|
||||||
case llvm::Triple::x86_64: {
|
|
||||||
auto i64Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt64Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i64Type, "syscall", "=r,{rax},{rdi},{rsi}", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num),
|
|
||||||
arg1->codegen(generator), arg2->codegen(generator)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case llvm::Triple::x86: {
|
|
||||||
auto i32Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i32Type, "int $2", "=r,{eax},i,{ebx},{ecx}", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num),
|
|
||||||
llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), 0x80),
|
|
||||||
arg1->codegen(generator), arg2->codegen(generator)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
Error::throw_error_without_location(
|
|
||||||
std::string("Unsupported arch for syscalls: ") +
|
|
||||||
Arguments::TargetTriple.getArchName(Arguments::TargetTriple.getArch()).str());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::Value* Syscall3Node::codegen(IRBuilder* generator)
|
|
||||||
{
|
|
||||||
switch (Arguments::TargetTriple.getArch())
|
|
||||||
{
|
|
||||||
case llvm::Triple::x86_64: {
|
|
||||||
auto i64Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt64Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i64Type, "syscall", "=r,{rax},{rdi},{rsi},{rcx}", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num),
|
|
||||||
arg1->codegen(generator), arg2->codegen(generator), arg3->codegen(generator)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case llvm::Triple::x86: {
|
|
||||||
auto i32Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i32Type, "int $2", "=r,{eax},i,{ebx},{ecx},{edx}", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num),
|
|
||||||
llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), 0x80),
|
|
||||||
arg1->codegen(generator), arg2->codegen(generator), arg3->codegen(generator)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
Error::throw_error_without_location(
|
|
||||||
std::string("Unsupported arch for syscalls: ") +
|
|
||||||
Arguments::TargetTriple.getArchName(Arguments::TargetTriple.getArch()).str());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::Value* Syscall4Node::codegen(IRBuilder* generator)
|
|
||||||
{
|
|
||||||
switch (Arguments::TargetTriple.getArch())
|
|
||||||
{
|
|
||||||
case llvm::Triple::x86_64: {
|
|
||||||
auto i64Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt64Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i64Type, "syscall", "=r,{rax},{rdi},{rsi},{rdx},{rcx}", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num),
|
|
||||||
arg1->codegen(generator), arg2->codegen(generator), arg3->codegen(generator), arg4->codegen(generator)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case llvm::Triple::x86: {
|
|
||||||
auto i32Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i32Type, "int $2", "=r,{eax},i,{ebx},{ecx},{edx},{esi}", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num),
|
|
||||||
llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), 0x80),
|
|
||||||
arg1->codegen(generator), arg2->codegen(generator), arg3->codegen(generator), arg4->codegen(generator)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
Error::throw_error_without_location(
|
|
||||||
std::string("Unsupported arch for syscalls: ") +
|
|
||||||
Arguments::TargetTriple.getArchName(Arguments::TargetTriple.getArch()).str());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::Value* Syscall5Node::codegen(IRBuilder* generator)
|
|
||||||
{
|
|
||||||
switch (Arguments::TargetTriple.getArch())
|
|
||||||
{
|
|
||||||
case llvm::Triple::x86_64: {
|
|
||||||
auto i64Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt64Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i64Type, "syscall", "=r,{rax},{rdi},{rsi},{rdx},{rcx},{r8}", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num),
|
|
||||||
arg1->codegen(generator), arg2->codegen(generator), arg3->codegen(generator), arg4->codegen(generator),
|
|
||||||
arg5->codegen(generator)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case llvm::Triple::x86: {
|
|
||||||
auto i32Type =
|
|
||||||
llvm::FunctionType::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), false);
|
|
||||||
auto inlineAsm = llvm::InlineAsm::get(i32Type, "int $2", "=r,{eax},i,{ebx},{ecx},{edx},{esi},{edi}", true);
|
|
||||||
return generator->getBuilder()->CreateCall(
|
|
||||||
inlineAsm,
|
|
||||||
{llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), sys_num),
|
|
||||||
llvm::ConstantInt::get(llvm::IntegerType::getInt32Ty(generator->getBuilder()->getContext()), 0x80),
|
|
||||||
arg1->codegen(generator), arg2->codegen(generator), arg3->codegen(generator), arg4->codegen(generator),
|
|
||||||
arg5->codegen(generator)});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
Error::throw_error_without_location(
|
|
||||||
std::string("Unsupported arch for syscalls: ") +
|
|
||||||
Arguments::TargetTriple.getArchName(Arguments::TargetTriple.getArch()).str());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,86 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "ExprNode.h"
|
|
||||||
|
|
||||||
class Syscall0Node final : public ExprNode
|
|
||||||
{
|
|
||||||
int sys_num;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Syscall0Node(int syscall_number);
|
|
||||||
~Syscall0Node();
|
|
||||||
|
|
||||||
llvm::Value* codegen(IRBuilder* generator) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Syscall1Node final : public ExprNode
|
|
||||||
{
|
|
||||||
int sys_num;
|
|
||||||
std::shared_ptr<ASTNode> arg1;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Syscall1Node(int syscall_number, std::shared_ptr<ASTNode> arg1);
|
|
||||||
~Syscall1Node();
|
|
||||||
|
|
||||||
llvm::Value* codegen(IRBuilder* generator) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Syscall2Node final : public ExprNode
|
|
||||||
{
|
|
||||||
int sys_num;
|
|
||||||
std::shared_ptr<ASTNode> arg1;
|
|
||||||
std::shared_ptr<ASTNode> arg2;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Syscall2Node(int syscall_number, std::shared_ptr<ASTNode> arg1, std::shared_ptr<ASTNode> arg2);
|
|
||||||
~Syscall2Node();
|
|
||||||
|
|
||||||
llvm::Value* codegen(IRBuilder* generator) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Syscall3Node final : public ExprNode
|
|
||||||
{
|
|
||||||
int sys_num;
|
|
||||||
std::shared_ptr<ASTNode> arg1;
|
|
||||||
std::shared_ptr<ASTNode> arg2;
|
|
||||||
std::shared_ptr<ASTNode> arg3;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Syscall3Node(int syscall_number, std::shared_ptr<ASTNode> arg1, std::shared_ptr<ASTNode> arg2,
|
|
||||||
std::shared_ptr<ASTNode> arg3);
|
|
||||||
~Syscall3Node();
|
|
||||||
|
|
||||||
llvm::Value* codegen(IRBuilder* generator) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Syscall4Node final : public ExprNode
|
|
||||||
{
|
|
||||||
int sys_num;
|
|
||||||
std::shared_ptr<ASTNode> arg1;
|
|
||||||
std::shared_ptr<ASTNode> arg2;
|
|
||||||
std::shared_ptr<ASTNode> arg3;
|
|
||||||
std::shared_ptr<ASTNode> arg4;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Syscall4Node(int syscall_number, std::shared_ptr<ASTNode> arg1, std::shared_ptr<ASTNode> arg2,
|
|
||||||
std::shared_ptr<ASTNode> arg3, std::shared_ptr<ASTNode> arg4);
|
|
||||||
~Syscall4Node();
|
|
||||||
|
|
||||||
llvm::Value* codegen(IRBuilder* generator) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Syscall5Node final : public ExprNode
|
|
||||||
{
|
|
||||||
int sys_num;
|
|
||||||
std::shared_ptr<ASTNode> arg1;
|
|
||||||
std::shared_ptr<ASTNode> arg2;
|
|
||||||
std::shared_ptr<ASTNode> arg3;
|
|
||||||
std::shared_ptr<ASTNode> arg4;
|
|
||||||
std::shared_ptr<ASTNode> arg5;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Syscall5Node(int syscall_number, std::shared_ptr<ASTNode> arg1, std::shared_ptr<ASTNode> arg2,
|
|
||||||
std::shared_ptr<ASTNode> arg3, std::shared_ptr<ASTNode> arg4, std::shared_ptr<ASTNode> arg5);
|
|
||||||
~Syscall5Node();
|
|
||||||
|
|
||||||
llvm::Value* codegen(IRBuilder* generator) override;
|
|
||||||
};
|
|
@ -1,11 +0,0 @@
|
|||||||
#include "TopLevelNode.h"
|
|
||||||
|
|
||||||
void TopLevelNode::codegen(IRBuilder*, llvm::Module*)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::Value* TopLevelNode::codegen(IRBuilder*)
|
|
||||||
{
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "ASTNode.h"
|
|
||||||
#include "llvm/IR/Module.h"
|
|
||||||
|
|
||||||
class IRBuilder;
|
|
||||||
|
|
||||||
class TopLevelNode : public ASTNode
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
TopLevelNode() = default;
|
|
||||||
~TopLevelNode() = default;
|
|
||||||
|
|
||||||
virtual void codegen(IRBuilder* builder, llvm::Module* module);
|
|
||||||
llvm::Value* codegen(IRBuilder* builder) override;
|
|
||||||
};
|
|
@ -1,9 +0,0 @@
|
|||||||
#include "UnaryOpNode.h"
|
|
||||||
|
|
||||||
UnaryOpNode::UnaryOpNode(std::shared_ptr<ExprNode> operand) : ExprNode(), operand(operand)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
UnaryOpNode::~UnaryOpNode()
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "ExprNode.h"
|
|
||||||
|
|
||||||
class UnaryOpNode : public ExprNode
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
std::shared_ptr<ExprNode> operand;
|
|
||||||
|
|
||||||
public:
|
|
||||||
UnaryOpNode(std::shared_ptr<ExprNode> operand);
|
|
||||||
~UnaryOpNode();
|
|
||||||
};
|
|
@ -1,86 +0,0 @@
|
|||||||
#include "Arguments.h"
|
|
||||||
#include "Error.h"
|
|
||||||
#include "tclap/CmdLine.h"
|
|
||||||
#include "utils.h"
|
|
||||||
#include "llvm/Support/Host.h"
|
|
||||||
|
|
||||||
std::map<std::string, bool> Arguments::flags;
|
|
||||||
std::map<std::string, std::string> Arguments::values;
|
|
||||||
llvm::Triple Arguments::TargetTriple;
|
|
||||||
|
|
||||||
void Arguments::parse(int argc, char** argv)
|
|
||||||
{
|
|
||||||
__benchmark_impl::init();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
TCLAP::CmdLine command_line("The Sapphire compiler.", ' ', "0.1");
|
|
||||||
|
|
||||||
#define CreateValueArgument(name, value_short, value_long, help, default_value) \
|
|
||||||
TCLAP::ValueArg<std::string> name##_Argument(value_short, value_long, help, false, default_value, "string"); \
|
|
||||||
command_line.add(name##_Argument)
|
|
||||||
|
|
||||||
#define CreateFlagArgument(name, value_short, value_long, help) \
|
|
||||||
TCLAP::SwitchArg name##_FlagArgument(value_short, value_long, help); \
|
|
||||||
command_line.add(name##_FlagArgument)
|
|
||||||
|
|
||||||
#define SaveValueArgument(name) Arguments::values[#name] = name##_Argument.getValue()
|
|
||||||
#define SaveFlagArgument(name) Arguments::flags[#name] = name##_FlagArgument.getValue()
|
|
||||||
|
|
||||||
TCLAP::UnlabeledValueArg<std::string> input_Argument("file", "Input file.", true, "program.sp", "string");
|
|
||||||
command_line.add(input_Argument);
|
|
||||||
|
|
||||||
CreateValueArgument(output, "o", "output", "Output file.", "output.o");
|
|
||||||
CreateValueArgument(arch, "", "arch", "Architecture to compile for.", "native");
|
|
||||||
CreateValueArgument(cpu, "", "cpu", "CPU to compile for.", "generic");
|
|
||||||
CreateValueArgument(system, "", "system", "Operating System to compile for.", "native");
|
|
||||||
CreateValueArgument(entry, "e", "entry", "Name of entry function.", "main");
|
|
||||||
|
|
||||||
CreateFlagArgument(emit_llvm, "", "emit-llvm", "Emit LLVM IR instead of an object file.");
|
|
||||||
CreateFlagArgument(omit_entry, "", "omit-entry", "Do not check for an entry point.");
|
|
||||||
|
|
||||||
#ifndef NO_BENCHMARKING
|
|
||||||
CreateFlagArgument(profile, "", "profile", "Show execution times for functions.");
|
|
||||||
#endif
|
|
||||||
command_line.parse(argc, argv);
|
|
||||||
|
|
||||||
SaveValueArgument(output);
|
|
||||||
SaveValueArgument(input);
|
|
||||||
SaveValueArgument(arch);
|
|
||||||
SaveValueArgument(system);
|
|
||||||
SaveValueArgument(cpu);
|
|
||||||
SaveValueArgument(entry);
|
|
||||||
SaveFlagArgument(emit_llvm);
|
|
||||||
SaveFlagArgument(omit_entry);
|
|
||||||
|
|
||||||
setTriple(values["arch"], values["system"]);
|
|
||||||
|
|
||||||
#ifndef NO_BENCHMARKING
|
|
||||||
SaveFlagArgument(profile);
|
|
||||||
if (flags["profile"]) __benchmark_impl::enable();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
catch (TCLAP::ArgException& e)
|
|
||||||
{
|
|
||||||
Error::throw_error_without_location(e.error());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Arguments::setTriple(const std::string& arch, const std::string& system)
|
|
||||||
{
|
|
||||||
std::string triple = llvm::sys::getDefaultTargetTriple();
|
|
||||||
llvm::Triple targetTriple(triple);
|
|
||||||
|
|
||||||
if (arch != "native")
|
|
||||||
{
|
|
||||||
targetTriple.setArchName(arch);
|
|
||||||
}
|
|
||||||
if (system != "native")
|
|
||||||
{
|
|
||||||
targetTriple.setOSName(system);
|
|
||||||
}
|
|
||||||
|
|
||||||
targetTriple.setVendor(llvm::Triple::VendorType::UnknownVendor); // let's leave it like that
|
|
||||||
targetTriple.setEnvironment(llvm::Triple::EnvironmentType::UnknownEnvironment);
|
|
||||||
|
|
||||||
TargetTriple = targetTriple;
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "sapphirepch.h"
|
|
||||||
#include <llvm/ADT/Triple.h>
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
struct Arguments
|
|
||||||
{
|
|
||||||
static void parse(int argc, char** argv);
|
|
||||||
|
|
||||||
static std::map<std::string, bool> flags;
|
|
||||||
static std::map<std::string, std::string> values;
|
|
||||||
static llvm::Triple TargetTriple;
|
|
||||||
|
|
||||||
private:
|
|
||||||
static void setTriple(const std::string& arch, const std::string& system);
|
|
||||||
};
|
|
147
src/Error.cpp
147
src/Error.cpp
@ -1,147 +0,0 @@
|
|||||||
#include "Error.h"
|
|
||||||
#include "utils.h"
|
|
||||||
#include <algorithm>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
void Error::show_import_line(const Location& loc, std::ostream& output_stream)
|
|
||||||
{
|
|
||||||
output_stream << "in file included from ";
|
|
||||||
|
|
||||||
output_stream << "\033[1;1m";
|
|
||||||
output_stream << loc.str();
|
|
||||||
|
|
||||||
output_stream << ": ";
|
|
||||||
|
|
||||||
output_stream << "\033[0;0m";
|
|
||||||
|
|
||||||
output_stream << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Error::show_import_lines(const Location& loc, void (*import_line_printer)(const Location&, std::ostream&),
|
|
||||||
std::ostream& stream)
|
|
||||||
{
|
|
||||||
std::vector<Location> locations;
|
|
||||||
Location scanned_loc = loc;
|
|
||||||
while (scanned_loc.parent)
|
|
||||||
{
|
|
||||||
locations.push_back(*scanned_loc.parent.get());
|
|
||||||
|
|
||||||
scanned_loc = *scanned_loc.parent.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::reverse(locations.begin(), locations.end());
|
|
||||||
|
|
||||||
for (const auto& location : locations)
|
|
||||||
{
|
|
||||||
import_line_printer(location, stream);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: Seems like the cursor that indicates where the error is is a bit offset to the right.
|
|
||||||
|
|
||||||
[[noreturn]] void Error::throw_error(const Location& loc, const std::string line_text, const std::string& details)
|
|
||||||
{
|
|
||||||
show_import_lines(loc, show_import_line, std::cerr);
|
|
||||||
|
|
||||||
std::string line = to_string(loc.line);
|
|
||||||
|
|
||||||
std::cerr << "\033[1;1m";
|
|
||||||
std::cerr << loc.str();
|
|
||||||
|
|
||||||
std::cerr << ": ";
|
|
||||||
|
|
||||||
std::cerr << "\033[31;49m";
|
|
||||||
std::cerr << "error: ";
|
|
||||||
|
|
||||||
std::cerr << "\033[0;0m";
|
|
||||||
std::cerr << details;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
std::cerr << line;
|
|
||||||
std::cerr << std::string(4, ' ');
|
|
||||||
std::cerr << line_text;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
std::cerr << std::string(4 + line.size() + loc.column - 1, ' ');
|
|
||||||
|
|
||||||
std::cerr << "\033[31;49m";
|
|
||||||
std::cerr << "^";
|
|
||||||
std::cerr << "\033[0;0m";
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[noreturn]] void Error::throw_error(const Location& loc, const std::string& details)
|
|
||||||
{
|
|
||||||
std::cerr << "\033[1;1m";
|
|
||||||
std::cerr << loc.str();
|
|
||||||
|
|
||||||
std::cerr << ": ";
|
|
||||||
|
|
||||||
std::cerr << "\033[31;49m";
|
|
||||||
std::cerr << "error: ";
|
|
||||||
|
|
||||||
std::cerr << "\033[0;0m";
|
|
||||||
std::cerr << details;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
[[noreturn]] void Error::throw_error_without_location(const std::string& details)
|
|
||||||
{
|
|
||||||
std::cerr << "\033[1;1m";
|
|
||||||
|
|
||||||
std::cerr << "\033[31;49m";
|
|
||||||
std::cerr << "error: ";
|
|
||||||
|
|
||||||
std::cerr << "\033[0;0m";
|
|
||||||
std::cerr << details;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Error::throw_warning_without_location(const std::string& details)
|
|
||||||
{
|
|
||||||
std::cerr << "\033[1;1m";
|
|
||||||
|
|
||||||
std::cerr << "\033[33;49m";
|
|
||||||
std::cerr << "warning: ";
|
|
||||||
|
|
||||||
std::cerr << "\033[0;0m";
|
|
||||||
std::cerr << details;
|
|
||||||
std::cerr << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Error::throw_warning(const Location& loc, const std::string line_text, const std::string& details)
|
|
||||||
{
|
|
||||||
show_import_lines(loc, show_import_line, std::cout);
|
|
||||||
|
|
||||||
std::string line = to_string(loc.line);
|
|
||||||
|
|
||||||
std::cout << "\033[1;1m";
|
|
||||||
std::cout << loc.str();
|
|
||||||
|
|
||||||
std::cout << ": ";
|
|
||||||
|
|
||||||
std::cout << "\033[33;49m";
|
|
||||||
std::cout << "warning: ";
|
|
||||||
|
|
||||||
std::cout << "\033[0;0m";
|
|
||||||
std::cout << details;
|
|
||||||
std::cout << std::endl;
|
|
||||||
|
|
||||||
std::cout << line;
|
|
||||||
std::cout << std::string(4, ' ');
|
|
||||||
std::cout << line_text;
|
|
||||||
std::cout << std::endl;
|
|
||||||
|
|
||||||
std::cout << std::string(4 + line.size() + loc.column - 1, ' ');
|
|
||||||
|
|
||||||
std::cout << "\033[33;49m";
|
|
||||||
std::cout << "^";
|
|
||||||
std::cout << "\033[0;0m";
|
|
||||||
std::cout << std::endl;
|
|
||||||
}
|
|
20
src/Error.h
20
src/Error.h
@ -1,20 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "Location.h"
|
|
||||||
|
|
||||||
namespace Error
|
|
||||||
{
|
|
||||||
void show_import_line(const Location& loc, std::ostream& output_stream);
|
|
||||||
|
|
||||||
[[noreturn]] void throw_error(const Location& loc, const std::string line_text, const std::string& details);
|
|
||||||
|
|
||||||
[[noreturn]] void throw_error(const Location& loc, const std::string& details);
|
|
||||||
|
|
||||||
[[noreturn]] void throw_error_without_location(const std::string& details);
|
|
||||||
|
|
||||||
void throw_warning(const Location& loc, const std::string line_text, const std::string& details);
|
|
||||||
|
|
||||||
void throw_warning_without_location(const std::string& details);
|
|
||||||
|
|
||||||
void show_import_lines(const Location& loc, void (*import_line_printer)(const Location&, std::ostream&),
|
|
||||||
std::ostream& stream);
|
|
||||||
} // namespace Error
|
|
@ -1,45 +0,0 @@
|
|||||||
#include "FileIO.h"
|
|
||||||
#include "Error.h"
|
|
||||||
#include "sapphirepch.h"
|
|
||||||
#include <cstring>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <filesystem>
|
|
||||||
#include <fstream>
|
|
||||||
|
|
||||||
std::string FileIO::read_all(const std::string& filename)
|
|
||||||
{
|
|
||||||
if (std::filesystem::is_directory(std::filesystem::status(filename)))
|
|
||||||
Error::throw_error_without_location("unable to open file " + filename + ": Is a directory");
|
|
||||||
std::ifstream file;
|
|
||||||
file.exceptions(std::ios::badbit | std::ios::failbit);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
file.open(filename);
|
|
||||||
}
|
|
||||||
catch (const std::exception& e)
|
|
||||||
{
|
|
||||||
Error::throw_error_without_location("unable to open file " + filename + ": " + strerror(errno));
|
|
||||||
}
|
|
||||||
file.exceptions(std::ios::goodbit);
|
|
||||||
std::vector<char> file_chars;
|
|
||||||
char fchar;
|
|
||||||
while (file.good())
|
|
||||||
{
|
|
||||||
fchar = file.get();
|
|
||||||
if (fchar != -1) file_chars.push_back(fchar);
|
|
||||||
}
|
|
||||||
file.close();
|
|
||||||
return std::string(file_chars.begin(), file_chars.end());
|
|
||||||
}
|
|
||||||
|
|
||||||
void FileIO::write_all(const std::string& filename, const std::string& contents)
|
|
||||||
{
|
|
||||||
std::ofstream file(filename);
|
|
||||||
file << contents;
|
|
||||||
file.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string FileIO::remove_file_extension(const std::string& filename)
|
|
||||||
{
|
|
||||||
return filename.substr(0, filename.find_last_of('.'));
|
|
||||||
}
|
|
13
src/FileIO.h
13
src/FileIO.h
@ -1,13 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "sapphirepch.h"
|
|
||||||
|
|
||||||
/* Namespace for simple file operations. */
|
|
||||||
namespace FileIO
|
|
||||||
{
|
|
||||||
/* Helper function to read all of a file's contents. */
|
|
||||||
std::string read_all(const std::string& filename);
|
|
||||||
/* Helper function to write a string to a file. */
|
|
||||||
void write_all(const std::string& filename, const std::string& contents);
|
|
||||||
/* Return a filename without its extension. */
|
|
||||||
std::string remove_file_extension(const std::string& filename);
|
|
||||||
} // namespace FileIO
|
|
@ -1,8 +0,0 @@
|
|||||||
#include "GlobalContext.h"
|
|
||||||
|
|
||||||
std::shared_ptr<llvm::LLVMContext> globalContext;
|
|
||||||
|
|
||||||
void initGlobalContext()
|
|
||||||
{
|
|
||||||
globalContext = std::make_shared<llvm::LLVMContext>();
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
#include "llvm/IR/LLVMContext.h"
|
|
||||||
|
|
||||||
extern std::shared_ptr<llvm::LLVMContext> globalContext;
|
|
||||||
|
|
||||||
void initGlobalContext();
|
|
@ -1,121 +0,0 @@
|
|||||||
#include "IRBuilder.h"
|
|
||||||
#include "Arguments.h"
|
|
||||||
#include "Error.h"
|
|
||||||
#include "FormatString/FormatString.hpp"
|
|
||||||
#include "GlobalContext.h"
|
|
||||||
#include "llvm/IR/Function.h"
|
|
||||||
#include "llvm/IR/LegacyPassManager.h"
|
|
||||||
#include "llvm/IR/Value.h"
|
|
||||||
#include "llvm/IR/Verifier.h"
|
|
||||||
#include "llvm/MC/TargetRegistry.h"
|
|
||||||
#include "llvm/Support/CodeGen.h"
|
|
||||||
#include "llvm/Support/FileSystem.h"
|
|
||||||
#include "llvm/Support/Host.h"
|
|
||||||
#include "llvm/Support/TargetSelect.h"
|
|
||||||
#include "llvm/Target/TargetMachine.h"
|
|
||||||
#include "llvm/Target/TargetOptions.h"
|
|
||||||
|
|
||||||
IRBuilder::IRBuilder()
|
|
||||||
{
|
|
||||||
context = globalContext;
|
|
||||||
builder = std::unique_ptr<llvm::IRBuilder<>>(new llvm::IRBuilder<>(*context));
|
|
||||||
module = std::make_unique<llvm::Module>(Arguments::values["input"], *context);
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::IRBuilder<>* IRBuilder::getBuilder()
|
|
||||||
{
|
|
||||||
return builder.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
void IRBuilder::create_program(std::shared_ptr<ProgramNode> program)
|
|
||||||
{
|
|
||||||
program->walk([&](std::shared_ptr<TopLevelNode> node) { node->codegen(this, module.get()); });
|
|
||||||
|
|
||||||
if (!Arguments::flags["omit_entry"])
|
|
||||||
{
|
|
||||||
if (!module->getFunction(Arguments::values["entry"]))
|
|
||||||
{
|
|
||||||
Error::throw_error_without_location(format_string("Missing entry point: %s", Arguments::values["entry"]));
|
|
||||||
}
|
|
||||||
if (module->getFunction(Arguments::values["entry"])->empty())
|
|
||||||
{
|
|
||||||
Error::throw_error_without_location(
|
|
||||||
format_string("Entry point %s has no body", Arguments::values["entry"]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void IRBuilder::resolveToLLVMIR(std::string_view path)
|
|
||||||
{
|
|
||||||
std::error_code EC;
|
|
||||||
llvm::raw_fd_ostream dest(path, EC, llvm::sys::fs::OF_None);
|
|
||||||
|
|
||||||
if (EC)
|
|
||||||
{
|
|
||||||
Error::throw_error_without_location(
|
|
||||||
format_string("Could not open file %s: %s", Arguments::values["output"], EC.message()));
|
|
||||||
}
|
|
||||||
|
|
||||||
module->print(dest, nullptr);
|
|
||||||
dest.flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
void IRBuilder::resolveToObjectFile(std::string_view path)
|
|
||||||
{
|
|
||||||
// edit this section when adding support for more architectures
|
|
||||||
LLVMInitializeX86TargetInfo();
|
|
||||||
LLVMInitializeAArch64TargetInfo();
|
|
||||||
LLVMInitializeX86Target();
|
|
||||||
LLVMInitializeAArch64Target();
|
|
||||||
LLVMInitializeX86TargetMC();
|
|
||||||
LLVMInitializeAArch64TargetMC();
|
|
||||||
LLVMInitializeX86AsmParser();
|
|
||||||
LLVMInitializeAArch64AsmParser();
|
|
||||||
LLVMInitializeX86AsmPrinter();
|
|
||||||
LLVMInitializeAArch64AsmPrinter();
|
|
||||||
|
|
||||||
std::string TargetTriple = Arguments::TargetTriple.getTriple();
|
|
||||||
|
|
||||||
module->setTargetTriple(TargetTriple);
|
|
||||||
|
|
||||||
std::string err;
|
|
||||||
auto Target = llvm::TargetRegistry::lookupTarget(TargetTriple, err);
|
|
||||||
if (!Target)
|
|
||||||
{
|
|
||||||
Error::throw_error_without_location(err);
|
|
||||||
}
|
|
||||||
std::string CPU;
|
|
||||||
if (Arguments::values["mcpu"] == "native")
|
|
||||||
{
|
|
||||||
CPU = llvm::sys::getHostCPUName();
|
|
||||||
Error::throw_warning_without_location("Using host CPU: " + CPU);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
CPU = Arguments::values["mcpu"];
|
|
||||||
auto Features = "";
|
|
||||||
|
|
||||||
llvm::TargetOptions opt;
|
|
||||||
auto RM = llvm::Optional<llvm::Reloc::Model>();
|
|
||||||
auto TheTargetMachine = Target->createTargetMachine(TargetTriple, CPU, Features, opt, RM);
|
|
||||||
|
|
||||||
module->setDataLayout(TheTargetMachine->createDataLayout());
|
|
||||||
|
|
||||||
std::error_code EC;
|
|
||||||
llvm::raw_fd_ostream dest(path, EC, llvm::sys::fs::OF_None);
|
|
||||||
|
|
||||||
if (EC)
|
|
||||||
{
|
|
||||||
Error::throw_error_without_location("Could not open file " + Arguments::values["output"] + " :" + EC.message());
|
|
||||||
}
|
|
||||||
|
|
||||||
llvm::legacy::PassManager pass;
|
|
||||||
auto FileType = llvm::CGFT_ObjectFile;
|
|
||||||
|
|
||||||
if (TheTargetMachine->addPassesToEmitFile(pass, dest, nullptr, FileType))
|
|
||||||
{
|
|
||||||
Error::throw_error_without_location("Cannot emit object file");
|
|
||||||
}
|
|
||||||
|
|
||||||
pass.run(*module);
|
|
||||||
dest.flush();
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "AST/ProgramNode.h"
|
|
||||||
#include "llvm/ADT/APFloat.h"
|
|
||||||
#include "llvm/IR/IRBuilder.h"
|
|
||||||
#include "llvm/IR/LLVMContext.h"
|
|
||||||
#include "llvm/IR/Module.h"
|
|
||||||
|
|
||||||
class ASTNode;
|
|
||||||
|
|
||||||
class IRBuilder
|
|
||||||
{
|
|
||||||
std::shared_ptr<llvm::LLVMContext> context;
|
|
||||||
std::unique_ptr<llvm::IRBuilder<>> builder;
|
|
||||||
std::unique_ptr<llvm::Module> module;
|
|
||||||
|
|
||||||
public:
|
|
||||||
IRBuilder();
|
|
||||||
void create_program(std::shared_ptr<ProgramNode> program);
|
|
||||||
|
|
||||||
llvm::IRBuilder<>* getBuilder();
|
|
||||||
|
|
||||||
void resolveToLLVMIR(std::string_view path);
|
|
||||||
|
|
||||||
void resolveToObjectFile(std::string_view path);
|
|
||||||
};
|
|
335
src/Lexer.cpp
335
src/Lexer.cpp
@ -1,335 +0,0 @@
|
|||||||
#include "Lexer.h"
|
|
||||||
#include "Error.h"
|
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
#define WHITESPACE "\t \n"
|
|
||||||
#define LETTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ_"
|
|
||||||
#define IDENTIFIERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ_0123456789"
|
|
||||||
#define DIGITS "0123456789"
|
|
||||||
|
|
||||||
Lexer::Lexer(const std::string& fname) : location(1, 0, fname), previous_location(1, 0, fname), index(-1)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Lexer::~Lexer()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
int Lexer::advance()
|
|
||||||
{
|
|
||||||
previous_location = Location{ location };
|
|
||||||
++index;
|
|
||||||
location.advance();
|
|
||||||
if (index >= (ssize_t)current_lexed_text.size()) return 0;
|
|
||||||
current_char = current_lexed_text[index];
|
|
||||||
location.pos_from_char(current_char);
|
|
||||||
if (current_char == '\n')
|
|
||||||
{
|
|
||||||
previous_line_text = current_line_text;
|
|
||||||
current_line_text = this->recalculate_current_line(current_lexed_text);
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Lexer::rewind()
|
|
||||||
{
|
|
||||||
location = previous_location;
|
|
||||||
--index;
|
|
||||||
if (index == -1) return 0;
|
|
||||||
if (current_char == '\n')
|
|
||||||
{
|
|
||||||
current_line_text = previous_line_text;
|
|
||||||
}
|
|
||||||
current_char = current_lexed_text[index];
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string Lexer::recalculate_current_line(const std::string& text)
|
|
||||||
{
|
|
||||||
ssize_t idx = index;
|
|
||||||
std::string final_str;
|
|
||||||
++idx;
|
|
||||||
while (idx != (ssize_t)text.size() && text[idx] != '\n')
|
|
||||||
{
|
|
||||||
final_str += text[idx];
|
|
||||||
++idx;
|
|
||||||
}
|
|
||||||
return final_str;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::unique_ptr<Lexer> Lexer::make_lexer(const std::string& fname)
|
|
||||||
{
|
|
||||||
return std::unique_ptr<Lexer>(new Lexer(fname)); // not using make_shared because the constructor is private
|
|
||||||
}
|
|
||||||
|
|
||||||
void Lexer::assign_parent_location(std::unique_ptr<Lexer>& lexer, const std::shared_ptr<Location>& loc)
|
|
||||||
{
|
|
||||||
lexer->location.parent = loc;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Lexer::is_in_string(const std::string& string, const char& character)
|
|
||||||
{
|
|
||||||
return string.find(character) != std::string::npos;
|
|
||||||
}
|
|
||||||
|
|
||||||
TokenStream Lexer::lex(const std::string& text)
|
|
||||||
{
|
|
||||||
TokenStream result;
|
|
||||||
bool comment = false;
|
|
||||||
current_lexed_text = text;
|
|
||||||
current_line_text = this->recalculate_current_line(current_lexed_text);
|
|
||||||
|
|
||||||
while (this->advance())
|
|
||||||
{
|
|
||||||
if (this->current_char == '\n') comment = false;
|
|
||||||
|
|
||||||
if (comment) continue;
|
|
||||||
|
|
||||||
if (is_in_string(WHITESPACE, current_char)) continue;
|
|
||||||
|
|
||||||
else if (is_in_string(LETTERS, current_char))
|
|
||||||
{
|
|
||||||
result.push_back(create_identifier());
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (is_in_string(DIGITS, current_char))
|
|
||||||
{
|
|
||||||
result.push_back(create_number());
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (current_char == '\'')
|
|
||||||
{
|
|
||||||
result.push_back(create_string());
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
switch (current_char)
|
|
||||||
{
|
|
||||||
case '/':
|
|
||||||
if (index + 1 != (ssize_t)current_lexed_text.size())
|
|
||||||
{
|
|
||||||
if (current_lexed_text[index + 1] == '/')
|
|
||||||
{
|
|
||||||
comment = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result.push_back(Token::make_with_line({TT_Div, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '+':
|
|
||||||
result.push_back(Token::make_with_line({TT_Plus, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '-':
|
|
||||||
result.push_back(Token::make_with_line({TT_Minus, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '*':
|
|
||||||
result.push_back(Token::make_with_line({TT_Mul, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '@':
|
|
||||||
result.push_back(Token::make_with_line({TT_At, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '=':
|
|
||||||
result.push_back(Token::make_with_line({TT_Equal, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '>':
|
|
||||||
result.push_back(Token::make_with_line({TT_GreaterThan, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '<':
|
|
||||||
result.push_back(Token::make_with_line({TT_LessThan, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '(':
|
|
||||||
result.push_back(Token::make_with_line({TT_LParen, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case ')':
|
|
||||||
result.push_back(Token::make_with_line({TT_RParen, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '{':
|
|
||||||
result.push_back(Token::make_with_line({TT_LBracket, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '}':
|
|
||||||
result.push_back(Token::make_with_line({TT_RBracket, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case ';':
|
|
||||||
result.push_back(Token::make_with_line({TT_Semicolon, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '.':
|
|
||||||
result.push_back(Token::make_with_line({TT_Period, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case ',':
|
|
||||||
result.push_back(Token::make_with_line({TT_Comma, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '!':
|
|
||||||
result.push_back(Token::make_with_line({TT_Exclamation, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '[':
|
|
||||||
result.push_back(Token::make_with_line({TT_Exclamation, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case ']':
|
|
||||||
result.push_back(Token::make_with_line({TT_Exclamation, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case ':':
|
|
||||||
result.push_back(Token::make_with_line({TT_Colon, location}, current_line_text));
|
|
||||||
break;
|
|
||||||
case '\377':
|
|
||||||
result.push_back(Token(TT_EOF, location));
|
|
||||||
return result;
|
|
||||||
default:
|
|
||||||
Error::throw_error(location, current_line_text, "unknown character");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
result.push_back(Token(TT_EOF, location));
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
Token Lexer::create_identifier()
|
|
||||||
{
|
|
||||||
std::vector<char> characters;
|
|
||||||
int prev_line = location.line;
|
|
||||||
int prev_column = location.column;
|
|
||||||
Location saved_loc = this->location;
|
|
||||||
Location saved_prev_loc = this->previous_location;
|
|
||||||
|
|
||||||
characters.push_back(current_char);
|
|
||||||
|
|
||||||
while (this->advance())
|
|
||||||
{
|
|
||||||
if (is_in_string(IDENTIFIERS, current_char))
|
|
||||||
{
|
|
||||||
characters.push_back(current_char);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->rewind();
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end:
|
|
||||||
std::string identifier(characters.begin(), characters.end());
|
|
||||||
if (identifier == "syscall0")
|
|
||||||
return std::move(
|
|
||||||
Token::make_with_line({TT_Syscall0, {prev_line, prev_column, location.filename}}, current_line_text));
|
|
||||||
if (identifier == "syscall1")
|
|
||||||
return std::move(
|
|
||||||
Token::make_with_line({TT_Syscall1, {prev_line, prev_column, location.filename}}, current_line_text));
|
|
||||||
if (identifier == "syscall2")
|
|
||||||
return std::move(
|
|
||||||
Token::make_with_line({TT_Syscall2, {prev_line, prev_column, location.filename}}, current_line_text));
|
|
||||||
if (identifier == "syscall3")
|
|
||||||
return std::move(
|
|
||||||
Token::make_with_line({TT_Syscall3, {prev_line, prev_column, location.filename}}, current_line_text));
|
|
||||||
if (identifier == "syscall4")
|
|
||||||
return std::move(
|
|
||||||
Token::make_with_line({TT_Syscall4, {prev_line, prev_column, location.filename}}, current_line_text));
|
|
||||||
if (identifier == "syscall5")
|
|
||||||
return std::move(
|
|
||||||
Token::make_with_line({TT_Syscall5, {prev_line, prev_column, location.filename}}, current_line_text));
|
|
||||||
if (identifier == "let")
|
|
||||||
return std::move(
|
|
||||||
Token::make_with_line({TT_Let, {prev_line, prev_column, location.filename}}, current_line_text));
|
|
||||||
if (identifier == "in")
|
|
||||||
return std::move(
|
|
||||||
Token::make_with_line({TT_In, {prev_line, prev_column, location.filename}}, current_line_text));
|
|
||||||
return std::move(Token::make_with_line({TT_Identifier, identifier, {prev_line, prev_column, location.filename}},
|
|
||||||
current_line_text));
|
|
||||||
}
|
|
||||||
|
|
||||||
Token Lexer::create_number()
|
|
||||||
{
|
|
||||||
std::vector<char> characters;
|
|
||||||
int prev_line = location.line;
|
|
||||||
int prev_column = location.column;
|
|
||||||
int dot_count = 0;
|
|
||||||
|
|
||||||
characters.push_back(current_char);
|
|
||||||
|
|
||||||
while (this->advance())
|
|
||||||
{
|
|
||||||
if (is_in_string(DIGITS, current_char))
|
|
||||||
{
|
|
||||||
characters.push_back(current_char);
|
|
||||||
}
|
|
||||||
else if (current_char == '.')
|
|
||||||
{
|
|
||||||
if (dot_count == 0)
|
|
||||||
{
|
|
||||||
characters.push_back(current_char);
|
|
||||||
++dot_count;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Error::throw_warning(location, current_line_text, "floats can only have one dot");
|
|
||||||
this->rewind();
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->rewind();
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
end:
|
|
||||||
if (dot_count != 0)
|
|
||||||
{
|
|
||||||
float value = std::stof(std::string(characters.begin(), characters.end()).c_str());
|
|
||||||
return std::move(
|
|
||||||
Token::make_with_line({TT_Float, value, {prev_line, prev_column, location.filename}}, current_line_text));
|
|
||||||
}
|
|
||||||
int value = std::atoi(std::string(characters.begin(), characters.end()).c_str());
|
|
||||||
return std::move(
|
|
||||||
Token::make_with_line({TT_Number, value, {prev_line, prev_column, location.filename}}, current_line_text));
|
|
||||||
}
|
|
||||||
|
|
||||||
Token Lexer::create_string()
|
|
||||||
{
|
|
||||||
std::vector<char> characters;
|
|
||||||
int prev_line = location.line;
|
|
||||||
int prev_column = location.column;
|
|
||||||
|
|
||||||
while (this->advance())
|
|
||||||
{
|
|
||||||
if (current_char == '\n')
|
|
||||||
{
|
|
||||||
this->rewind();
|
|
||||||
Error::throw_error(location, current_line_text, "expected end of string but got newline");
|
|
||||||
}
|
|
||||||
if (current_char == '\'')
|
|
||||||
{
|
|
||||||
std::string identifier(characters.begin(), characters.end());
|
|
||||||
return std::move(Token::make_with_line({TT_String, identifier, {prev_line, prev_column, location.filename}},
|
|
||||||
current_line_text));
|
|
||||||
}
|
|
||||||
if (current_char == '\\')
|
|
||||||
{
|
|
||||||
if (index + 1 == (ssize_t)current_lexed_text.size())
|
|
||||||
{
|
|
||||||
Error::throw_error(location, current_line_text, "unfinished escape sequence");
|
|
||||||
}
|
|
||||||
switch (current_lexed_text[index + 1])
|
|
||||||
{
|
|
||||||
case 'n':
|
|
||||||
characters.push_back('\n');
|
|
||||||
break;
|
|
||||||
case '\'':
|
|
||||||
characters.push_back('\'');
|
|
||||||
break;
|
|
||||||
case '\\':
|
|
||||||
characters.push_back('\\');
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Error::throw_error(location, current_line_text, "unknown escape sequence");
|
|
||||||
}
|
|
||||||
++index;
|
|
||||||
++location.column;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
characters.push_back(current_char);
|
|
||||||
}
|
|
||||||
this->rewind();
|
|
||||||
Error::throw_error(location, current_line_text, "expected end of string but got EOF");
|
|
||||||
|
|
||||||
return *(Token*)nullptr; // unreachable
|
|
||||||
}
|
|
50
src/Lexer.h
50
src/Lexer.h
@ -1,50 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "Token.h"
|
|
||||||
#include "sapphirepch.h"
|
|
||||||
#include <array>
|
|
||||||
|
|
||||||
/* Let's redefine TokenStream, as if it wasn't already defined in Token.h*/
|
|
||||||
typedef std::vector<Token> TokenStream;
|
|
||||||
/* The number of data types currently in Sapphire. */
|
|
||||||
#define TYPE_COUNT 14
|
|
||||||
|
|
||||||
/* The Lexer for the Sapphire compiler. A Lexer reads source code from a file, and turns it into a stream of tokens the
|
|
||||||
* compiler can understand. */
|
|
||||||
class Lexer
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
Location location;
|
|
||||||
Location previous_location;
|
|
||||||
|
|
||||||
int advance();
|
|
||||||
int rewind();
|
|
||||||
char current_char;
|
|
||||||
ssize_t index;
|
|
||||||
|
|
||||||
Lexer(const std::string& filename);
|
|
||||||
|
|
||||||
std::string current_line_text;
|
|
||||||
std::string previous_line_text;
|
|
||||||
|
|
||||||
std::string current_lexed_text;
|
|
||||||
|
|
||||||
std::string recalculate_current_line(const std::string& text);
|
|
||||||
|
|
||||||
Token create_string();
|
|
||||||
Token create_number();
|
|
||||||
Token create_identifier();
|
|
||||||
|
|
||||||
bool is_in_string(const std::string& string, const char& character);
|
|
||||||
|
|
||||||
public:
|
|
||||||
~Lexer();
|
|
||||||
|
|
||||||
/* Lex the given text, turning it into a stream of tokens. */
|
|
||||||
TokenStream lex(const std::string& text);
|
|
||||||
|
|
||||||
/* Create a new Lexer and return a pointer to it. */
|
|
||||||
static std::unique_ptr<Lexer> make_lexer(const std::string& filename);
|
|
||||||
|
|
||||||
/* If the Lexer is lexing an impòrted file, give it the location in the parent file at which it was imported. */
|
|
||||||
static void assign_parent_location(std::unique_ptr<Lexer>& lexer, const std::shared_ptr<Location>& loc);
|
|
||||||
};
|
|
@ -1,48 +0,0 @@
|
|||||||
#include "Location.h"
|
|
||||||
#include "FormatString/FormatString.hpp"
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
Location::Location(int line, int column, std::string filename)
|
|
||||||
: line(line), column(column), filename(std::move(filename))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Location::~Location()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string Location::str() const
|
|
||||||
{
|
|
||||||
return format_string("%s:%d:%d", filename, line, column);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Location::advance()
|
|
||||||
{
|
|
||||||
++column;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Location::pos_from_char(const char& character)
|
|
||||||
{
|
|
||||||
if (character == '\n')
|
|
||||||
{
|
|
||||||
++line;
|
|
||||||
column = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Location::Location(const Location& other)
|
|
||||||
: line(other.line), column(other.column), filename(other.filename), parent(other.parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Location::Location(Location&& other)
|
|
||||||
: line(other.line), column(other.column), filename(std::move(other.filename)), parent(std::move(other.parent))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Location Location::copy(const Location& other)
|
|
||||||
{
|
|
||||||
Location result(other.line, other.column, other.filename);
|
|
||||||
result.parent = other.parent;
|
|
||||||
return result;
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "sapphirepch.h"
|
|
||||||
|
|
||||||
/* Struct to represent a location in a file. */
|
|
||||||
struct Location
|
|
||||||
{
|
|
||||||
int line;
|
|
||||||
int column;
|
|
||||||
std::string filename;
|
|
||||||
|
|
||||||
/* The location at which this location was imported, for error traces in imported files. */
|
|
||||||
std::shared_ptr<Location> parent = nullptr;
|
|
||||||
|
|
||||||
/* Creates a Location with the given parameters. */
|
|
||||||
Location(int line, int column, std::string filename);
|
|
||||||
|
|
||||||
Location(Location&& other);
|
|
||||||
Location(const Location& other);
|
|
||||||
|
|
||||||
Location operator=(const Location& other)
|
|
||||||
{
|
|
||||||
return Location(other);
|
|
||||||
}
|
|
||||||
|
|
||||||
~Location();
|
|
||||||
|
|
||||||
/* Returns a string of the format FILE:LINE:COL. */
|
|
||||||
std::string str() const;
|
|
||||||
|
|
||||||
/* Advance to the next column in the file. */
|
|
||||||
void advance();
|
|
||||||
|
|
||||||
/* Advance to the next line if provided a newline. */
|
|
||||||
void pos_from_char(const char& character);
|
|
||||||
|
|
||||||
/* Returns a copy of the original Location. */
|
|
||||||
static Location copy(const Location& other);
|
|
||||||
};
|
|
||||||
|
|
||||||
#define CURRENT_LOCATION (Location {__LINE__, 0, __FILE__})
|
|
162
src/Parser.cpp
162
src/Parser.cpp
@ -1,162 +0,0 @@
|
|||||||
#include "Parser.h"
|
|
||||||
#include "AST/EmptyFunctionNode.h"
|
|
||||||
#include "AST/FunctionNode.h"
|
|
||||||
#include "AST/MulNode.h"
|
|
||||||
#include "AST/SumNode.h"
|
|
||||||
#include "FormatString/FormatString.hpp"
|
|
||||||
#include "GlobalContext.h"
|
|
||||||
|
|
||||||
Parser::Parser(const TokenStream& tokens) : tokens(tokens)
|
|
||||||
{
|
|
||||||
m_type_map = {{"void", llvm::Type::getVoidTy(*globalContext)}, {"bool", llvm::Type::getInt1Ty(*globalContext)},
|
|
||||||
{"i8", llvm::Type::getInt8Ty(*globalContext)}, {"i16", llvm::Type::getInt16Ty(*globalContext)},
|
|
||||||
{"i32", llvm::Type::getInt32Ty(*globalContext)}, {"i64", llvm::Type::getInt64Ty(*globalContext)},
|
|
||||||
{"f32", llvm::Type::getFloatTy(*globalContext)}, {"f64", llvm::Type::getDoubleTy(*globalContext)}};
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<Parser> Parser::new_parser(const TokenStream& tokens)
|
|
||||||
{
|
|
||||||
return std::shared_ptr<Parser>(
|
|
||||||
new Parser(tokens)); // As always, not using std::make_shared 'cause constructor is private
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<ProgramNode> Parser::parse()
|
|
||||||
{
|
|
||||||
advance();
|
|
||||||
std::shared_ptr<ProgramNode> final_result = std::make_shared<ProgramNode>();
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
auto result = toplevel();
|
|
||||||
if (result.is_error()) result.ethrow();
|
|
||||||
final_result->append(result.get());
|
|
||||||
if (current_token->type == TT_EOF) break;
|
|
||||||
}
|
|
||||||
return final_result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int Parser::advance()
|
|
||||||
{
|
|
||||||
++index;
|
|
||||||
if (index < (ssize_t)tokens.size())
|
|
||||||
{
|
|
||||||
current_token = &tokens[index];
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<ExprNode> Parser::factor()
|
|
||||||
{
|
|
||||||
Token& token = *current_token;
|
|
||||||
|
|
||||||
if (token.type == TT_Number)
|
|
||||||
{
|
|
||||||
advance();
|
|
||||||
assert(token.int_value.has_value());
|
|
||||||
return Ok<ExprNode>(new IntegerNode(token.int_value.value()), &token);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (token.type == TT_Float)
|
|
||||||
{
|
|
||||||
advance();
|
|
||||||
assert(token.float_value.has_value());
|
|
||||||
return Ok<ExprNode>(new FloatNode(token.float_value.value()), &token);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Err<ExprNode>("expected a number", &token);
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<ExprNode> Parser::term()
|
|
||||||
{
|
|
||||||
Result<ExprNode> left = factor();
|
|
||||||
if (left.is_error()) return left;
|
|
||||||
while (current_token->type == TT_Mul || current_token->type == TT_Div)
|
|
||||||
{
|
|
||||||
Token& op = *current_token;
|
|
||||||
advance();
|
|
||||||
Result<ExprNode> right = factor();
|
|
||||||
if (right.is_error()) return right;
|
|
||||||
left = Ok<ExprNode>(new MulNode(left.get(), right.get(), op.type == TT_Mul ? '*' : '/'), &op);
|
|
||||||
}
|
|
||||||
return left;
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<ExprNode> Parser::expr()
|
|
||||||
{
|
|
||||||
Result<ExprNode> left = term();
|
|
||||||
if (left.is_error()) return left;
|
|
||||||
while (current_token->type == TT_Plus || current_token->type == TT_Minus)
|
|
||||||
{
|
|
||||||
Token& op = *current_token;
|
|
||||||
advance();
|
|
||||||
Result<ExprNode> right = term();
|
|
||||||
if (right.is_error()) return right;
|
|
||||||
left = Ok<ExprNode>(new SumNode(left.get(), right.get(), op.type == TT_Plus ? '+' : '-'), &op);
|
|
||||||
}
|
|
||||||
return left;
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<TopLevelNode> Parser::toplevel()
|
|
||||||
{
|
|
||||||
// FIXME: Add more top-level stuff later, for now it's only functions.
|
|
||||||
return function();
|
|
||||||
}
|
|
||||||
|
|
||||||
Result<TopLevelNode> Parser::function()
|
|
||||||
{
|
|
||||||
FunctionPrototype proto;
|
|
||||||
Token* start_token = current_token;
|
|
||||||
proto.returnType = m_type_map["void"]; // FIXME: allow specifying return type
|
|
||||||
proto.arguments = {}; // FIXME: allow specifying arguments
|
|
||||||
if (current_token->type != TT_Let) return Err<TopLevelNode>("Expected let", current_token);
|
|
||||||
advance();
|
|
||||||
if (current_token->type != TT_At) return Err<TopLevelNode>("Expected @", current_token);
|
|
||||||
advance();
|
|
||||||
if (current_token->type != TT_Identifier) return Err<TopLevelNode>("Expected an identifier", current_token);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
assert(current_token->string_value.has_value());
|
|
||||||
proto.name = current_token->string_value.value();
|
|
||||||
}
|
|
||||||
advance();
|
|
||||||
if (current_token->type != TT_In && current_token->type != TT_Semicolon && current_token->type != TT_Colon)
|
|
||||||
return Err<TopLevelNode>("Expected 'in', colon or semicolon", current_token);
|
|
||||||
if (current_token->type == TT_Semicolon)
|
|
||||||
{
|
|
||||||
advance();
|
|
||||||
return Ok<TopLevelNode>(new EmptyFunctionNode(proto), start_token);
|
|
||||||
}
|
|
||||||
if (current_token->type == TT_Colon)
|
|
||||||
{
|
|
||||||
advance();
|
|
||||||
if (current_token->type != TT_Identifier)
|
|
||||||
{
|
|
||||||
return Err<TopLevelNode>("Expected type name", current_token);
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
proto.returnType = m_type_map.at(current_token->string_value.value());
|
|
||||||
}
|
|
||||||
catch (const std::out_of_range&)
|
|
||||||
{
|
|
||||||
return Err<TopLevelNode>("Expected type name", current_token);
|
|
||||||
}
|
|
||||||
advance();
|
|
||||||
if (current_token->type != TT_In && current_token->type != TT_Semicolon)
|
|
||||||
return Err<TopLevelNode>("Expected 'in' or semicolon", current_token);
|
|
||||||
if (current_token->type == TT_Semicolon)
|
|
||||||
{
|
|
||||||
advance();
|
|
||||||
return Ok<TopLevelNode>(new EmptyFunctionNode(proto), start_token);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
advance();
|
|
||||||
if (current_token->type != TT_LBracket)
|
|
||||||
return Err<TopLevelNode>("Invalid syntax",
|
|
||||||
current_token); // FIXME: Do not be lazy and return a meaningful error message.
|
|
||||||
advance();
|
|
||||||
Result<ExprNode> body = expr();
|
|
||||||
if (body.is_error()) return Err<TopLevelNode>(body.error(), body.token());
|
|
||||||
if (current_token->type != TT_RBracket) return Err<TopLevelNode>("Invalid syntax", current_token);
|
|
||||||
advance();
|
|
||||||
return Ok<TopLevelNode>(new FunctionNode(proto, body.get()), start_token);
|
|
||||||
}
|
|
35
src/Parser.h
35
src/Parser.h
@ -1,35 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "AST/NumberNode.h"
|
|
||||||
#include "AST/ProgramNode.h"
|
|
||||||
#include "AST/SumNode.h"
|
|
||||||
#include "Error.h"
|
|
||||||
#include "Lexer.h"
|
|
||||||
#include "Result.h"
|
|
||||||
#include "sapphirepch.h"
|
|
||||||
#include "llvm/IR/Type.h"
|
|
||||||
|
|
||||||
/* Parser class for the Sapphire compiler. */
|
|
||||||
class Parser
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
Parser(const TokenStream& tokens);
|
|
||||||
TokenStream tokens;
|
|
||||||
ssize_t index = -1;
|
|
||||||
int advance();
|
|
||||||
Token* current_token;
|
|
||||||
|
|
||||||
std::unordered_map<std::string, llvm::Type*> m_type_map;
|
|
||||||
|
|
||||||
Result<ExprNode> factor();
|
|
||||||
Result<ExprNode> expr();
|
|
||||||
Result<ExprNode> term();
|
|
||||||
|
|
||||||
Result<TopLevelNode> toplevel();
|
|
||||||
Result<TopLevelNode> function();
|
|
||||||
|
|
||||||
public:
|
|
||||||
/* Construct a new Parser with the given TokenStream. */
|
|
||||||
static std::shared_ptr<Parser> new_parser(const TokenStream& tokens);
|
|
||||||
/* Parse the stored TokenStream and return the top-level node of the result Abstract Syntax Tree. */
|
|
||||||
std::shared_ptr<ProgramNode> parse();
|
|
||||||
};
|
|
60
src/Result.h
60
src/Result.h
@ -1,60 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "Error.h"
|
|
||||||
#include "Token.h"
|
|
||||||
|
|
||||||
// Kinda copying Rust here, but it's a great idea.
|
|
||||||
|
|
||||||
template<typename T> class Result
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Result() = default;
|
|
||||||
bool is_error() const
|
|
||||||
{
|
|
||||||
return m_is_error;
|
|
||||||
}
|
|
||||||
void ethrow()
|
|
||||||
{
|
|
||||||
Error::throw_error(m_token->location, m_token->line(), m_error);
|
|
||||||
}
|
|
||||||
Token* token()
|
|
||||||
{
|
|
||||||
return m_token;
|
|
||||||
}
|
|
||||||
std::shared_ptr<T> get()
|
|
||||||
{
|
|
||||||
return m_result;
|
|
||||||
}
|
|
||||||
std::string error()
|
|
||||||
{
|
|
||||||
return m_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
Token* m_token;
|
|
||||||
std::shared_ptr<T> m_result;
|
|
||||||
bool m_is_error;
|
|
||||||
std::string m_error;
|
|
||||||
|
|
||||||
Result(T* result, Token* token) : m_token(token), m_result(result), m_is_error(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
Result(std::string&& error, Token* token) : m_token(token), m_is_error(true), m_error(error)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T> class Ok final : public Result<T>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Ok(T* result, Token* token) : Result<T>(result, token)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T> class Err final : public Result<T>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Err(std::string error, Token* token) : Result<T>(std::move(error), token)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
};
|
|
@ -1,94 +0,0 @@
|
|||||||
#include "Token.h"
|
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
Token::Token(const Token& other) : type(other.type), location(other.location), m_line_text(other.m_line_text)
|
|
||||||
{
|
|
||||||
if (other.int_value.has_value())
|
|
||||||
{
|
|
||||||
int_value = other.int_value.value();
|
|
||||||
}
|
|
||||||
else if (other.float_value.has_value())
|
|
||||||
{
|
|
||||||
float_value = other.float_value.value();
|
|
||||||
}
|
|
||||||
else if (other.string_value.has_value())
|
|
||||||
{
|
|
||||||
string_value = other.string_value.value();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Token::Token(TokenType type) : type(type), location(0, 0, "")
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Token::Token(TokenType type, const Location& location) : type(type), location(location)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Token::Token(TokenType type, std::string value) : type(type), string_value(std::move(value)), location(0, 0, "")
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Token::Token(TokenType type, int value, const Location& location) : type(type), int_value(value), location(location)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Token::Token(TokenType type, std::string value, const Location& location)
|
|
||||||
: type(type), string_value(std::move(value)), location(location)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Token::Token(TokenType type, float value, const Location& location) : type(type), float_value(value), location(location)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Token Token::copy_with_new_type(const TokenType& type) const
|
|
||||||
{
|
|
||||||
Token result(type, location);
|
|
||||||
|
|
||||||
result.m_line_text = m_line_text;
|
|
||||||
|
|
||||||
if (int_value.has_value())
|
|
||||||
{
|
|
||||||
result.int_value = int_value.value();
|
|
||||||
}
|
|
||||||
else if (float_value.has_value())
|
|
||||||
{
|
|
||||||
result.float_value = float_value.value();
|
|
||||||
}
|
|
||||||
else if (string_value.has_value())
|
|
||||||
{
|
|
||||||
result.string_value = string_value.value();
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
Token Token::make_with_line(const Token& origin, const std::string& line_text)
|
|
||||||
{
|
|
||||||
Token result = origin.copy_with_new_type(origin.type);
|
|
||||||
|
|
||||||
result.m_line_text = line_text;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Token::operator=(const Token& other)
|
|
||||||
{
|
|
||||||
type = other.type;
|
|
||||||
location = other.location;
|
|
||||||
m_line_text = other.m_line_text;
|
|
||||||
|
|
||||||
if (other.int_value.has_value())
|
|
||||||
{
|
|
||||||
int_value = other.int_value.value();
|
|
||||||
}
|
|
||||||
else if (other.float_value.has_value())
|
|
||||||
{
|
|
||||||
float_value = other.float_value.value();
|
|
||||||
}
|
|
||||||
else if (other.string_value.has_value())
|
|
||||||
{
|
|
||||||
string_value = other.string_value.value();
|
|
||||||
}
|
|
||||||
}
|
|
97
src/Token.h
97
src/Token.h
@ -1,97 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include "Location.h"
|
|
||||||
#include "sapphirepch.h"
|
|
||||||
|
|
||||||
/* All current token types. Will change in the future. */
|
|
||||||
enum TokenType
|
|
||||||
{
|
|
||||||
TT_Identifier,
|
|
||||||
TT_Number,
|
|
||||||
TT_Float,
|
|
||||||
TT_Keyword,
|
|
||||||
TT_String,
|
|
||||||
TT_Plus,
|
|
||||||
TT_Minus,
|
|
||||||
TT_Mul,
|
|
||||||
TT_Div,
|
|
||||||
TT_At,
|
|
||||||
TT_Equal,
|
|
||||||
TT_LessThan,
|
|
||||||
TT_GreaterThan,
|
|
||||||
TT_LParen,
|
|
||||||
TT_RParen,
|
|
||||||
TT_LBracket,
|
|
||||||
TT_RBracket,
|
|
||||||
TT_Semicolon,
|
|
||||||
TT_LoadedString,
|
|
||||||
TT_EOF,
|
|
||||||
TT_Equals,
|
|
||||||
TT_GTE,
|
|
||||||
TT_LTE,
|
|
||||||
TT_Period,
|
|
||||||
TT_Comma,
|
|
||||||
TT_Exclamation,
|
|
||||||
TT_NEqual,
|
|
||||||
TT_LSQB,
|
|
||||||
TT_RSQB,
|
|
||||||
TT_Syscall0,
|
|
||||||
TT_Syscall1,
|
|
||||||
TT_Syscall2,
|
|
||||||
TT_Syscall3,
|
|
||||||
TT_Syscall4,
|
|
||||||
TT_Syscall5,
|
|
||||||
TT_Let,
|
|
||||||
TT_In,
|
|
||||||
TT_Colon,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Struct to represent tokens generated by the Lexer. */
|
|
||||||
struct Token
|
|
||||||
{
|
|
||||||
TokenType type;
|
|
||||||
|
|
||||||
std::optional<int> int_value;
|
|
||||||
std::optional<std::string> string_value;
|
|
||||||
std::optional<float> float_value;
|
|
||||||
|
|
||||||
Location location;
|
|
||||||
|
|
||||||
Token(const Token& other);
|
|
||||||
|
|
||||||
Token(TokenType type);
|
|
||||||
|
|
||||||
Token(TokenType type, const Location& location);
|
|
||||||
|
|
||||||
Token(TokenType type, int value, const Location& location);
|
|
||||||
|
|
||||||
Token(TokenType type, std::string value, const Location& location);
|
|
||||||
|
|
||||||
Token(TokenType type, std::string value);
|
|
||||||
|
|
||||||
Token(TokenType type, float val, const Location& location);
|
|
||||||
|
|
||||||
~Token() = default;
|
|
||||||
|
|
||||||
/* Return the contents of the line where the Token was located. */
|
|
||||||
std::string line() const
|
|
||||||
{
|
|
||||||
return m_line_text;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return a copy of the original token, but adding the contents of the line where
|
|
||||||
the token was located. */
|
|
||||||
static Token make_with_line(const Token& origin, const std::string& line_text);
|
|
||||||
|
|
||||||
void operator=(const Token& other);
|
|
||||||
|
|
||||||
/* Return a copy of this Token, but with its TokenType changed. */
|
|
||||||
Token copy_with_new_type(const TokenType& type) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
// FIXME: this should be moved to Location, to remove all Token* that are only used to throw errors at a certain
|
|
||||||
// location.
|
|
||||||
std::string m_line_text;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* typedef to make it easier to see a what a std::vector of tokens is being used for. */
|
|
||||||
typedef std::vector<Token> TokenStream;
|
|
44
src/external/FormatString/FormatString.hpp
vendored
44
src/external/FormatString/FormatString.hpp
vendored
@ -1,44 +0,0 @@
|
|||||||
// Taken from https://github.com/InversePalindrome/Blog/blob/master/FormatString/FormatString.hpp
|
|
||||||
|
|
||||||
/*
|
|
||||||
Copyright (c) 2019 Inverse Palindrome
|
|
||||||
Blog - FormatString.hpp
|
|
||||||
https://inversepalindrome.com/
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
auto convert(T&& t)
|
|
||||||
{
|
|
||||||
if constexpr (std::is_same<std::remove_cv_t<std::remove_reference_t<T>>, std::string>::value)
|
|
||||||
{
|
|
||||||
return std::forward<T>(t).c_str();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return std::forward<T>(t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename... Args>
|
|
||||||
std::string format_string_internal(const std::string& format, Args&& ... args)
|
|
||||||
{
|
|
||||||
const auto size = std::snprintf(nullptr, 0, format.c_str(), std::forward<Args>(args)...) + 1;
|
|
||||||
const auto buffer = std::make_unique<char[]>(size);
|
|
||||||
|
|
||||||
std::snprintf(buffer.get(), size, format.c_str(), std::forward<Args>(args)...);
|
|
||||||
|
|
||||||
return std::string(buffer.get(), buffer.get() + size - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename... Args>
|
|
||||||
std::string format_string(const std::string& format, Args&& ... args)
|
|
||||||
{
|
|
||||||
return format_string_internal(format, convert(std::forward<Args>(args))...);
|
|
||||||
}
|
|
21
src/external/FormatString/LICENSE
vendored
21
src/external/FormatString/LICENSE
vendored
@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 Inverse Palindrome
|
|
||||||
|
|
||||||
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.
|
|
6
src/external/tclap-1.2.5/AUTHORS
vendored
6
src/external/tclap-1.2.5/AUTHORS
vendored
@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
original author: Michael E. Smoot
|
|
||||||
current maintainer: Daniel Aarno
|
|
||||||
more contributions: Erik Zeek
|
|
||||||
more contributions: Fabien Carmagnac (Tinbergen-AM)
|
|
||||||
outstanding editing: Carol Smoot
|
|
27
src/external/tclap-1.2.5/COPYING
vendored
27
src/external/tclap-1.2.5/COPYING
vendored
@ -1,27 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
Copyright (c) 2003 Michael E. Smoot
|
|
||||||
Copyright (c) 2004 Daniel Aarno
|
|
||||||
Copyright (c) 2017 Google Inc.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
1786
src/external/tclap-1.2.5/ChangeLog
vendored
1786
src/external/tclap-1.2.5/ChangeLog
vendored
File diff suppressed because it is too large
Load Diff
182
src/external/tclap-1.2.5/INSTALL
vendored
182
src/external/tclap-1.2.5/INSTALL
vendored
@ -1,182 +0,0 @@
|
|||||||
Basic Installation
|
|
||||||
==================
|
|
||||||
|
|
||||||
These are generic installation instructions.
|
|
||||||
|
|
||||||
The `configure' shell script attempts to guess correct values for
|
|
||||||
various system-dependent variables used during compilation. It uses
|
|
||||||
those values to create a `Makefile' in each directory of the package.
|
|
||||||
It may also create one or more `.h' files containing system-dependent
|
|
||||||
definitions. Finally, it creates a shell script `config.status' that
|
|
||||||
you can run in the future to recreate the current configuration, a file
|
|
||||||
`config.cache' that saves the results of its tests to speed up
|
|
||||||
reconfiguring, and a file `config.log' containing compiler output
|
|
||||||
(useful mainly for debugging `configure').
|
|
||||||
|
|
||||||
If you need to do unusual things to compile the package, please try
|
|
||||||
to figure out how `configure' could check whether to do them, and mail
|
|
||||||
diffs or instructions to the address given in the `README' so they can
|
|
||||||
be considered for the next release. If at some point `config.cache'
|
|
||||||
contains results you don't want to keep, you may remove or edit it.
|
|
||||||
|
|
||||||
The file `configure.in' is used to create `configure' by a program
|
|
||||||
called `autoconf'. You only need `configure.in' if you want to change
|
|
||||||
it or regenerate `configure' using a newer version of `autoconf'.
|
|
||||||
|
|
||||||
The simplest way to compile this package is:
|
|
||||||
|
|
||||||
1. `cd' to the directory containing the package's source code and type
|
|
||||||
`./configure' to configure the package for your system. If you're
|
|
||||||
using `csh' on an old version of System V, you might need to type
|
|
||||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
|
||||||
`configure' itself.
|
|
||||||
|
|
||||||
Running `configure' takes awhile. While running, it prints some
|
|
||||||
messages telling which features it is checking for.
|
|
||||||
|
|
||||||
2. Type `make' to compile the package.
|
|
||||||
|
|
||||||
3. Optionally, type `make check' to run any self-tests that come with
|
|
||||||
the package.
|
|
||||||
|
|
||||||
4. Type `make install' to install the programs and any data files and
|
|
||||||
documentation.
|
|
||||||
|
|
||||||
5. You can remove the program binaries and object files from the
|
|
||||||
source code directory by typing `make clean'. To also remove the
|
|
||||||
files that `configure' created (so you can compile the package for
|
|
||||||
a different kind of computer), type `make distclean'. There is
|
|
||||||
also a `make maintainer-clean' target, but that is intended mainly
|
|
||||||
for the package's developers. If you use it, you may have to get
|
|
||||||
all sorts of other programs in order to regenerate files that came
|
|
||||||
with the distribution.
|
|
||||||
|
|
||||||
Compilers and Options
|
|
||||||
=====================
|
|
||||||
|
|
||||||
Some systems require unusual options for compilation or linking that
|
|
||||||
the `configure' script does not know about. You can give `configure'
|
|
||||||
initial values for variables by setting them in the environment. Using
|
|
||||||
a Bourne-compatible shell, you can do that on the command line like
|
|
||||||
this:
|
|
||||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
|
||||||
|
|
||||||
Or on systems that have the `env' program, you can do it like this:
|
|
||||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
|
||||||
|
|
||||||
Compiling For Multiple Architectures
|
|
||||||
====================================
|
|
||||||
|
|
||||||
You can compile the package for more than one kind of computer at the
|
|
||||||
same time, by placing the object files for each architecture in their
|
|
||||||
own directory. To do this, you must use a version of `make' that
|
|
||||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
|
||||||
directory where you want the object files and executables to go and run
|
|
||||||
the `configure' script. `configure' automatically checks for the
|
|
||||||
source code in the directory that `configure' is in and in `..'.
|
|
||||||
|
|
||||||
If you have to use a `make' that does not supports the `VPATH'
|
|
||||||
variable, you have to compile the package for one architecture at a time
|
|
||||||
in the source code directory. After you have installed the package for
|
|
||||||
one architecture, use `make distclean' before reconfiguring for another
|
|
||||||
architecture.
|
|
||||||
|
|
||||||
Installation Names
|
|
||||||
==================
|
|
||||||
|
|
||||||
By default, `make install' will install the package's files in
|
|
||||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
|
||||||
installation prefix other than `/usr/local' by giving `configure' the
|
|
||||||
option `--prefix=PATH'.
|
|
||||||
|
|
||||||
You can specify separate installation prefixes for
|
|
||||||
architecture-specific files and architecture-independent files. If you
|
|
||||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
|
||||||
PATH as the prefix for installing programs and libraries.
|
|
||||||
Documentation and other data files will still use the regular prefix.
|
|
||||||
|
|
||||||
In addition, if you use an unusual directory layout you can give
|
|
||||||
options like `--bindir=PATH' to specify different values for particular
|
|
||||||
kinds of files. Run `configure --help' for a list of the directories
|
|
||||||
you can set and what kinds of files go in them.
|
|
||||||
|
|
||||||
If the package supports it, you can cause programs to be installed
|
|
||||||
with an extra prefix or suffix on their names by giving `configure' the
|
|
||||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
|
||||||
|
|
||||||
Optional Features
|
|
||||||
=================
|
|
||||||
|
|
||||||
Some packages pay attention to `--enable-FEATURE' options to
|
|
||||||
`configure', where FEATURE indicates an optional part of the package.
|
|
||||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
|
||||||
is something like `gnu-as' or `x' (for the X Window System). The
|
|
||||||
`README' should mention any `--enable-' and `--with-' options that the
|
|
||||||
package recognizes.
|
|
||||||
|
|
||||||
For packages that use the X Window System, `configure' can usually
|
|
||||||
find the X include and library files automatically, but if it doesn't,
|
|
||||||
you can use the `configure' options `--x-includes=DIR' and
|
|
||||||
`--x-libraries=DIR' to specify their locations.
|
|
||||||
|
|
||||||
Specifying the System Type
|
|
||||||
==========================
|
|
||||||
|
|
||||||
There may be some features `configure' can not figure out
|
|
||||||
automatically, but needs to determine by the type of host the package
|
|
||||||
will run on. Usually `configure' can figure that out, but if it prints
|
|
||||||
a message saying it can not guess the host type, give it the
|
|
||||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
|
||||||
type, such as `sun4', or a canonical name with three fields:
|
|
||||||
CPU-COMPANY-SYSTEM
|
|
||||||
|
|
||||||
See the file `config.sub' for the possible values of each field. If
|
|
||||||
`config.sub' isn't included in this package, then this package doesn't
|
|
||||||
need to know the host type.
|
|
||||||
|
|
||||||
If you are building compiler tools for cross-compiling, you can also
|
|
||||||
use the `--target=TYPE' option to select the type of system they will
|
|
||||||
produce code for and the `--build=TYPE' option to select the type of
|
|
||||||
system on which you are compiling the package.
|
|
||||||
|
|
||||||
Sharing Defaults
|
|
||||||
================
|
|
||||||
|
|
||||||
If you want to set default values for `configure' scripts to share,
|
|
||||||
you can create a site shell script called `config.site' that gives
|
|
||||||
default values for variables like `CC', `cache_file', and `prefix'.
|
|
||||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
|
||||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
|
||||||
`CONFIG_SITE' environment variable to the location of the site script.
|
|
||||||
A warning: not all `configure' scripts look for a site script.
|
|
||||||
|
|
||||||
Operation Controls
|
|
||||||
==================
|
|
||||||
|
|
||||||
`configure' recognizes the following options to control how it
|
|
||||||
operates.
|
|
||||||
|
|
||||||
`--cache-file=FILE'
|
|
||||||
Use and save the results of the tests in FILE instead of
|
|
||||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
|
||||||
debugging `configure'.
|
|
||||||
|
|
||||||
`--help'
|
|
||||||
Print a summary of the options to `configure', and exit.
|
|
||||||
|
|
||||||
`--quiet'
|
|
||||||
`--silent'
|
|
||||||
`-q'
|
|
||||||
Do not print messages saying which checks are being made. To
|
|
||||||
suppress all normal output, redirect it to `/dev/null' (any error
|
|
||||||
messages will still be shown).
|
|
||||||
|
|
||||||
`--srcdir=DIR'
|
|
||||||
Look for the package's source code in directory DIR. Usually
|
|
||||||
`configure' can determine that directory automatically.
|
|
||||||
|
|
||||||
`--version'
|
|
||||||
Print the version of Autoconf used to generate the `configure'
|
|
||||||
script, and exit.
|
|
||||||
|
|
||||||
`configure' also accepts some other, not widely useful, options.
|
|
10
src/external/tclap-1.2.5/Makefile.am
vendored
10
src/external/tclap-1.2.5/Makefile.am
vendored
@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I config
|
|
||||||
|
|
||||||
SUBDIRS = include examples docs tests msc config
|
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
|
||||||
pkgconfig_DATA = $(PACKAGE).pc
|
|
||||||
EXTRA_DIST = $(PACKAGE).pc.in
|
|
||||||
|
|
||||||
DISTCLEANFILES = $(PACKAGE).pc
|
|
830
src/external/tclap-1.2.5/Makefile.in
vendored
830
src/external/tclap-1.2.5/Makefile.in
vendored
@ -1,830 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.16.4 from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
|
|
||||||
VPATH = @srcdir@
|
|
||||||
am__is_gnu_make = { \
|
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
|
||||||
false; \
|
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
am__make_running_with_option = \
|
|
||||||
case $${target_option-} in \
|
|
||||||
?) ;; \
|
|
||||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
|
||||||
"target option '$${target_option-}' specified" >&2; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
has_opt=no; \
|
|
||||||
sane_makeflags=$$MAKEFLAGS; \
|
|
||||||
if $(am__is_gnu_make); then \
|
|
||||||
sane_makeflags=$$MFLAGS; \
|
|
||||||
else \
|
|
||||||
case $$MAKEFLAGS in \
|
|
||||||
*\\[\ \ ]*) \
|
|
||||||
bs=\\; \
|
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
|
||||||
esac; \
|
|
||||||
fi; \
|
|
||||||
skip_next=no; \
|
|
||||||
strip_trailopt () \
|
|
||||||
{ \
|
|
||||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
|
||||||
}; \
|
|
||||||
for flg in $$sane_makeflags; do \
|
|
||||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
|
||||||
case $$flg in \
|
|
||||||
*=*|--*) continue;; \
|
|
||||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
|
||||||
-*I?*) strip_trailopt 'I';; \
|
|
||||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
|
||||||
-*O?*) strip_trailopt 'O';; \
|
|
||||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
|
||||||
-*l?*) strip_trailopt 'l';; \
|
|
||||||
-[dEDm]) skip_next=yes;; \
|
|
||||||
-[JT]) skip_next=yes;; \
|
|
||||||
esac; \
|
|
||||||
case $$flg in \
|
|
||||||
*$$target_option*) has_opt=yes; break;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
test $$has_opt = yes
|
|
||||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
|
||||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
subdir = .
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/config/ac_cxx_have_long_long.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_have_sstream.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_have_strstream.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_namespaces.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_warn_effective_cxx.m4 \
|
|
||||||
$(top_srcdir)/config/bb_enable_doxygen.m4 \
|
|
||||||
$(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|
||||||
$(ACLOCAL_M4)
|
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
|
|
||||||
$(am__configure_deps) $(am__DIST_COMMON)
|
|
||||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
|
||||||
configure.lineno config.status.lineno
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config/config.h
|
|
||||||
CONFIG_CLEAN_FILES = tclap.pc
|
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
|
||||||
AM_V_P = $(am__v_P_@AM_V@)
|
|
||||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
|
||||||
am__v_P_0 = false
|
|
||||||
am__v_P_1 = :
|
|
||||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
|
||||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
|
||||||
am__v_GEN_0 = @echo " GEN " $@;
|
|
||||||
am__v_GEN_1 =
|
|
||||||
AM_V_at = $(am__v_at_@AM_V@)
|
|
||||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|
||||||
am__v_at_0 = @
|
|
||||||
am__v_at_1 =
|
|
||||||
SOURCES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
|
||||||
ctags-recursive dvi-recursive html-recursive info-recursive \
|
|
||||||
install-data-recursive install-dvi-recursive \
|
|
||||||
install-exec-recursive install-html-recursive \
|
|
||||||
install-info-recursive install-pdf-recursive \
|
|
||||||
install-ps-recursive install-recursive installcheck-recursive \
|
|
||||||
installdirs-recursive pdf-recursive ps-recursive \
|
|
||||||
tags-recursive uninstall-recursive
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
|
||||||
am__vpath_adj = case $$p in \
|
|
||||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
|
||||||
*) f=$$p;; \
|
|
||||||
esac;
|
|
||||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
|
||||||
am__install_max = 40
|
|
||||||
am__nobase_strip_setup = \
|
|
||||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
|
||||||
am__nobase_strip = \
|
|
||||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
|
||||||
am__nobase_list = $(am__nobase_strip_setup); \
|
|
||||||
for p in $$list; do echo "$$p $$p"; done | \
|
|
||||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
|
||||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
|
||||||
if (++n[$$2] == $(am__install_max)) \
|
|
||||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
|
||||||
END { for (dir in files) print dir, files[dir] }'
|
|
||||||
am__base_list = \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
|
||||||
am__uninstall_files_from_dir = { \
|
|
||||||
test -z "$$files" \
|
|
||||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
|
||||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
|
||||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
|
||||||
}
|
|
||||||
am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
|
|
||||||
DATA = $(pkgconfig_DATA)
|
|
||||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
|
||||||
distclean-recursive maintainer-clean-recursive
|
|
||||||
am__recursive_targets = \
|
|
||||||
$(RECURSIVE_TARGETS) \
|
|
||||||
$(RECURSIVE_CLEAN_TARGETS) \
|
|
||||||
$(am__extra_recursive_targets)
|
|
||||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
|
||||||
cscope distdir distdir-am dist dist-all distcheck
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
||||||
# Read a list of newline-separated strings from the standard input,
|
|
||||||
# and print each of them once, without duplicates. Input order is
|
|
||||||
# *not* preserved.
|
|
||||||
am__uniquify_input = $(AWK) '\
|
|
||||||
BEGIN { nonempty = 0; } \
|
|
||||||
{ items[$$0] = 1; nonempty = 1; } \
|
|
||||||
END { if (nonempty) { for (i in items) print i; }; } \
|
|
||||||
'
|
|
||||||
# Make sure the list of sources is unique. This is necessary because,
|
|
||||||
# e.g., the same source file might be shared among _SOURCES variables
|
|
||||||
# for different programs/libraries.
|
|
||||||
am__define_uniq_tagged_files = \
|
|
||||||
list='$(am__tagged_files)'; \
|
|
||||||
unique=`for i in $$list; do \
|
|
||||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|
||||||
done | $(am__uniquify_input)`
|
|
||||||
DIST_SUBDIRS = $(SUBDIRS)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/tclap.pc.in \
|
|
||||||
$(top_srcdir)/config/install-sh $(top_srcdir)/config/missing \
|
|
||||||
$(top_srcdir)/config/mkinstalldirs AUTHORS COPYING ChangeLog \
|
|
||||||
INSTALL NEWS README
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
distdir = $(PACKAGE)-$(VERSION)
|
|
||||||
top_distdir = $(distdir)
|
|
||||||
am__remove_distdir = \
|
|
||||||
if test -d "$(distdir)"; then \
|
|
||||||
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
|
||||||
&& rm -rf "$(distdir)" \
|
|
||||||
|| { sleep 5 && rm -rf "$(distdir)"; }; \
|
|
||||||
else :; fi
|
|
||||||
am__post_remove_distdir = $(am__remove_distdir)
|
|
||||||
am__relativize = \
|
|
||||||
dir0=`pwd`; \
|
|
||||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
|
||||||
sed_rest='s,^[^/]*/*,,'; \
|
|
||||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
|
||||||
sed_butlast='s,/*[^/]*$$,,'; \
|
|
||||||
while test -n "$$dir1"; do \
|
|
||||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
|
||||||
if test "$$first" != "."; then \
|
|
||||||
if test "$$first" = ".."; then \
|
|
||||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
|
||||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
|
||||||
else \
|
|
||||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
|
||||||
if test "$$first2" = "$$first"; then \
|
|
||||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
|
||||||
else \
|
|
||||||
dir2="../$$dir2"; \
|
|
||||||
fi; \
|
|
||||||
dir0="$$dir0"/"$$first"; \
|
|
||||||
fi; \
|
|
||||||
fi; \
|
|
||||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
|
||||||
done; \
|
|
||||||
reldir="$$dir2"
|
|
||||||
DIST_ARCHIVES = $(distdir).tar.gz
|
|
||||||
GZIP_ENV = --best
|
|
||||||
DIST_TARGETS = dist-gzip
|
|
||||||
# Exists only to be overridden by the user if desired.
|
|
||||||
AM_DISTCHECK_DVI_TARGET = dvi
|
|
||||||
distuninstallcheck_listfiles = find . -type f -print
|
|
||||||
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
|
|
||||||
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
|
|
||||||
distcleancheck_listfiles = find . -type f -print
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AWK = @AWK@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CSCOPE = @CSCOPE@
|
|
||||||
CTAGS = @CTAGS@
|
|
||||||
CXX = @CXX@
|
|
||||||
CXXDEPMODE = @CXXDEPMODE@
|
|
||||||
CXXFLAGS = @CXXFLAGS@
|
|
||||||
CYGPATH_W = @CYGPATH_W@
|
|
||||||
DEFS = @DEFS@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
DOT = @DOT@
|
|
||||||
DOXYGEN = @DOXYGEN@
|
|
||||||
ECHO_C = @ECHO_C@
|
|
||||||
ECHO_N = @ECHO_N@
|
|
||||||
ECHO_T = @ECHO_T@
|
|
||||||
ETAGS = @ETAGS@
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LIBOBJS = @LIBOBJS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
|
||||||
MAKEINFO = @MAKEINFO@
|
|
||||||
MKDIR_P = @MKDIR_P@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
SET_MAKE = @SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
WARN_EFFECTIVE_CXX = @WARN_EFFECTIVE_CXX@
|
|
||||||
WARN_NO_EFFECTIVE_CXX = @WARN_NO_EFFECTIVE_CXX@
|
|
||||||
abs_builddir = @abs_builddir@
|
|
||||||
abs_srcdir = @abs_srcdir@
|
|
||||||
abs_top_builddir = @abs_top_builddir@
|
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__leading_dot = @am__leading_dot@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
am__tar = @am__tar@
|
|
||||||
am__untar = @am__untar@
|
|
||||||
bindir = @bindir@
|
|
||||||
build_alias = @build_alias@
|
|
||||||
builddir = @builddir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
docdir = @docdir@
|
|
||||||
dvidir = @dvidir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
host_alias = @host_alias@
|
|
||||||
htmldir = @htmldir@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
libdir = @libdir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
localedir = @localedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
mandir = @mandir@
|
|
||||||
mkdir_p = @mkdir_p@
|
|
||||||
oldincludedir = @oldincludedir@
|
|
||||||
pdfdir = @pdfdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
program_transform_name = @program_transform_name@
|
|
||||||
psdir = @psdir@
|
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
target_alias = @target_alias@
|
|
||||||
top_build_prefix = @top_build_prefix@
|
|
||||||
top_builddir = @top_builddir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
ACLOCAL_AMFLAGS = -I config
|
|
||||||
SUBDIRS = include examples docs tests msc config
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
|
||||||
pkgconfig_DATA = $(PACKAGE).pc
|
|
||||||
EXTRA_DIST = $(PACKAGE).pc.in
|
|
||||||
DISTCLEANFILES = $(PACKAGE).pc
|
|
||||||
all: all-recursive
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
am--refresh: Makefile
|
|
||||||
@:
|
|
||||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
|
|
||||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
|
|
||||||
&& exit 0; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
echo ' $(SHELL) ./config.status'; \
|
|
||||||
$(SHELL) ./config.status;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
$(SHELL) ./config.status --recheck
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: $(am__configure_deps)
|
|
||||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
|
||||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
|
||||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
|
||||||
$(am__aclocal_m4_deps):
|
|
||||||
tclap.pc: $(top_builddir)/config.status $(srcdir)/tclap.pc.in
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
|
||||||
install-pkgconfigDATA: $(pkgconfig_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-pkgconfigDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
|
|
||||||
# This directory's subdirectories are mostly independent; you can cd
|
|
||||||
# into them and run 'make' without going through this Makefile.
|
|
||||||
# To change the values of 'make' variables: instead of editing Makefiles,
|
|
||||||
# (1) if the variable is set in 'config.status', edit 'config.status'
|
|
||||||
# (which will cause the Makefiles to be regenerated when you run 'make');
|
|
||||||
# (2) otherwise, pass the desired values on the 'make' command line.
|
|
||||||
$(am__recursive_targets):
|
|
||||||
@fail=; \
|
|
||||||
if $(am__make_keepgoing); then \
|
|
||||||
failcom='fail=yes'; \
|
|
||||||
else \
|
|
||||||
failcom='exit 1'; \
|
|
||||||
fi; \
|
|
||||||
dot_seen=no; \
|
|
||||||
target=`echo $@ | sed s/-recursive//`; \
|
|
||||||
case "$@" in \
|
|
||||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
|
||||||
*) list='$(SUBDIRS)' ;; \
|
|
||||||
esac; \
|
|
||||||
for subdir in $$list; do \
|
|
||||||
echo "Making $$target in $$subdir"; \
|
|
||||||
if test "$$subdir" = "."; then \
|
|
||||||
dot_seen=yes; \
|
|
||||||
local_target="$$target-am"; \
|
|
||||||
else \
|
|
||||||
local_target="$$target"; \
|
|
||||||
fi; \
|
|
||||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
|
||||||
|| eval $$failcom; \
|
|
||||||
done; \
|
|
||||||
if test "$$dot_seen" = "no"; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
|
||||||
fi; test -z "$$fail"
|
|
||||||
|
|
||||||
ID: $(am__tagged_files)
|
|
||||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
|
||||||
tags: tags-recursive
|
|
||||||
TAGS: tags
|
|
||||||
|
|
||||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|
||||||
set x; \
|
|
||||||
here=`pwd`; \
|
|
||||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
|
||||||
include_option=--etags-include; \
|
|
||||||
empty_fix=.; \
|
|
||||||
else \
|
|
||||||
include_option=--include; \
|
|
||||||
empty_fix=; \
|
|
||||||
fi; \
|
|
||||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
test ! -f $$subdir/TAGS || \
|
|
||||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
|
||||||
fi; \
|
|
||||||
done; \
|
|
||||||
$(am__define_uniq_tagged_files); \
|
|
||||||
shift; \
|
|
||||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
|
||||||
test -n "$$unique" || unique=$$empty_fix; \
|
|
||||||
if test $$# -gt 0; then \
|
|
||||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|
||||||
"$$@" $$unique; \
|
|
||||||
else \
|
|
||||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|
||||||
$$unique; \
|
|
||||||
fi; \
|
|
||||||
fi
|
|
||||||
ctags: ctags-recursive
|
|
||||||
|
|
||||||
CTAGS: ctags
|
|
||||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|
||||||
$(am__define_uniq_tagged_files); \
|
|
||||||
test -z "$(CTAGS_ARGS)$$unique" \
|
|
||||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
|
||||||
$$unique
|
|
||||||
|
|
||||||
GTAGS:
|
|
||||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
|
||||||
&& $(am__cd) $(top_srcdir) \
|
|
||||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
|
||||||
cscope: cscope.files
|
|
||||||
test ! -s cscope.files \
|
|
||||||
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
|
|
||||||
clean-cscope:
|
|
||||||
-rm -f cscope.files
|
|
||||||
cscope.files: clean-cscope cscopelist
|
|
||||||
cscopelist: cscopelist-recursive
|
|
||||||
|
|
||||||
cscopelist-am: $(am__tagged_files)
|
|
||||||
list='$(am__tagged_files)'; \
|
|
||||||
case "$(srcdir)" in \
|
|
||||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
|
||||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
|
||||||
esac; \
|
|
||||||
for i in $$list; do \
|
|
||||||
if test -f "$$i"; then \
|
|
||||||
echo "$(subdir)/$$i"; \
|
|
||||||
else \
|
|
||||||
echo "$$sdir/$$i"; \
|
|
||||||
fi; \
|
|
||||||
done >> $(top_builddir)/cscope.files
|
|
||||||
|
|
||||||
distclean-tags:
|
|
||||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
|
||||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
|
||||||
distdir: $(BUILT_SOURCES)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
$(am__remove_distdir)
|
|
||||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
list='$(DISTFILES)'; \
|
|
||||||
dist_files=`for file in $$list; do echo $$file; done | \
|
|
||||||
sed -e "s|^$$srcdirstrip/||;t" \
|
|
||||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|
||||||
case $$dist_files in \
|
|
||||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|
||||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|
||||||
sort -u` ;; \
|
|
||||||
esac; \
|
|
||||||
for file in $$dist_files; do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test -d "$(distdir)/$$file"; then \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|
||||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
else \
|
|
||||||
test -f "$(distdir)/$$file" \
|
|
||||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
|
||||||
if test "$$subdir" = .; then :; else \
|
|
||||||
$(am__make_dryrun) \
|
|
||||||
|| test -d "$(distdir)/$$subdir" \
|
|
||||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
|
||||||
|| exit 1; \
|
|
||||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
|
||||||
$(am__relativize); \
|
|
||||||
new_distdir=$$reldir; \
|
|
||||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
|
||||||
$(am__relativize); \
|
|
||||||
new_top_distdir=$$reldir; \
|
|
||||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
|
||||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
|
||||||
($(am__cd) $$subdir && \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
top_distdir="$$new_top_distdir" \
|
|
||||||
distdir="$$new_distdir" \
|
|
||||||
am__remove_distdir=: \
|
|
||||||
am__skip_length_check=: \
|
|
||||||
am__skip_mode_fix=: \
|
|
||||||
distdir) \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
-test -n "$(am__skip_mode_fix)" \
|
|
||||||
|| find "$(distdir)" -type d ! -perm -755 \
|
|
||||||
-exec chmod u+rwx,go+rx {} \; -o \
|
|
||||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
|
||||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
|
||||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
|
||||||
|| chmod -R a+r "$(distdir)"
|
|
||||||
dist-gzip: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-bzip2: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-lzip: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-xz: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-zstd: distdir
|
|
||||||
tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-tarZ: distdir
|
|
||||||
@echo WARNING: "Support for distribution archives compressed with" \
|
|
||||||
"legacy program 'compress' is deprecated." >&2
|
|
||||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
|
||||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-shar: distdir
|
|
||||||
@echo WARNING: "Support for shar distribution archives is" \
|
|
||||||
"deprecated." >&2
|
|
||||||
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
|
|
||||||
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist-zip: distdir
|
|
||||||
-rm -f $(distdir).zip
|
|
||||||
zip -rq $(distdir).zip $(distdir)
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
dist dist-all:
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
|
|
||||||
# This target untars the dist file and tries a VPATH configuration. Then
|
|
||||||
# it guarantees that the distribution is self-contained by making another
|
|
||||||
# tarfile.
|
|
||||||
distcheck: dist
|
|
||||||
case '$(DIST_ARCHIVES)' in \
|
|
||||||
*.tar.gz*) \
|
|
||||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
|
|
||||||
*.tar.bz2*) \
|
|
||||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
|
||||||
*.tar.lz*) \
|
|
||||||
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
|
|
||||||
*.tar.xz*) \
|
|
||||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
|
||||||
*.tar.Z*) \
|
|
||||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
|
||||||
*.shar.gz*) \
|
|
||||||
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
|
|
||||||
*.zip*) \
|
|
||||||
unzip $(distdir).zip ;;\
|
|
||||||
*.tar.zst*) \
|
|
||||||
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
|
|
||||||
esac
|
|
||||||
chmod -R a-w $(distdir)
|
|
||||||
chmod u+w $(distdir)
|
|
||||||
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
|
|
||||||
chmod a-w $(distdir)
|
|
||||||
test -d $(distdir)/_build || exit 0; \
|
|
||||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
|
||||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
|
||||||
&& am__cwd=`pwd` \
|
|
||||||
&& $(am__cd) $(distdir)/_build/sub \
|
|
||||||
&& ../../configure \
|
|
||||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
|
|
||||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
|
||||||
--srcdir=../.. --prefix="$$dc_install_base" \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
|
||||||
distuninstallcheck \
|
|
||||||
&& chmod -R a-w "$$dc_install_base" \
|
|
||||||
&& ({ \
|
|
||||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
|
||||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
|
||||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
|
||||||
&& rm -rf "$$dc_destdir" \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
|
||||||
&& rm -rf $(DIST_ARCHIVES) \
|
|
||||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
|
||||||
&& cd "$$am__cwd" \
|
|
||||||
|| exit 1
|
|
||||||
$(am__post_remove_distdir)
|
|
||||||
@(echo "$(distdir) archives ready for distribution: "; \
|
|
||||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
|
||||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
|
||||||
distuninstallcheck:
|
|
||||||
@test -n '$(distuninstallcheck_dir)' || { \
|
|
||||||
echo 'ERROR: trying to run $@ with an empty' \
|
|
||||||
'$$(distuninstallcheck_dir)' >&2; \
|
|
||||||
exit 1; \
|
|
||||||
}; \
|
|
||||||
$(am__cd) '$(distuninstallcheck_dir)' || { \
|
|
||||||
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
|
|
||||||
exit 1; \
|
|
||||||
}; \
|
|
||||||
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|
|
||||||
|| { echo "ERROR: files left after uninstall:" ; \
|
|
||||||
if test -n "$(DESTDIR)"; then \
|
|
||||||
echo " (check DESTDIR support)"; \
|
|
||||||
fi ; \
|
|
||||||
$(distuninstallcheck_listfiles) ; \
|
|
||||||
exit 1; } >&2
|
|
||||||
distcleancheck: distclean
|
|
||||||
@if test '$(srcdir)' = . ; then \
|
|
||||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
|
||||||
exit 1 ; \
|
|
||||||
fi
|
|
||||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
|
||||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
|
||||||
$(distcleancheck_listfiles) ; \
|
|
||||||
exit 1; } >&2
|
|
||||||
check-am: all-am
|
|
||||||
check: check-recursive
|
|
||||||
all-am: Makefile $(DATA)
|
|
||||||
installdirs: installdirs-recursive
|
|
||||||
installdirs-am:
|
|
||||||
for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
|
|
||||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
|
||||||
done
|
|
||||||
install: install-recursive
|
|
||||||
install-exec: install-exec-recursive
|
|
||||||
install-data: install-data-recursive
|
|
||||||
uninstall: uninstall-recursive
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-recursive
|
|
||||||
install-strip:
|
|
||||||
if test -z '$(STRIP)'; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
install; \
|
|
||||||
else \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|
||||||
fi
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
|
||||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
|
||||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-recursive
|
|
||||||
|
|
||||||
clean-am: clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-recursive
|
|
||||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic distclean-tags
|
|
||||||
|
|
||||||
dvi: dvi-recursive
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-recursive
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-recursive
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am: install-pkgconfigDATA
|
|
||||||
|
|
||||||
install-dvi: install-dvi-recursive
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-recursive
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-recursive
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-recursive
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-recursive
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-recursive
|
|
||||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
|
||||||
-rm -rf $(top_srcdir)/autom4te.cache
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-recursive
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic
|
|
||||||
|
|
||||||
pdf: pdf-recursive
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-recursive
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am: uninstall-pkgconfigDATA
|
|
||||||
|
|
||||||
.MAKE: $(am__recursive_targets) install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
|
|
||||||
am--refresh check check-am clean clean-cscope clean-generic \
|
|
||||||
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
|
|
||||||
dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
|
|
||||||
dist-zstd distcheck distclean distclean-generic distclean-tags \
|
|
||||||
distcleancheck distdir distuninstallcheck dvi dvi-am html \
|
|
||||||
html-am info info-am install install-am install-data \
|
|
||||||
install-data-am install-dvi install-dvi-am install-exec \
|
|
||||||
install-exec-am install-html install-html-am install-info \
|
|
||||||
install-info-am install-man install-pdf install-pdf-am \
|
|
||||||
install-pkgconfigDATA install-ps install-ps-am install-strip \
|
|
||||||
installcheck installcheck-am installdirs installdirs-am \
|
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
|
||||||
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
|
|
||||||
uninstall-am uninstall-pkgconfigDATA
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
0
src/external/tclap-1.2.5/NEWS
vendored
0
src/external/tclap-1.2.5/NEWS
vendored
12
src/external/tclap-1.2.5/README
vendored
12
src/external/tclap-1.2.5/README
vendored
@ -1,12 +0,0 @@
|
|||||||
TCLAP - Templatized Command Line Argument Parser
|
|
||||||
|
|
||||||
This is a simple C++ library that facilitates parsing command line
|
|
||||||
arguments in a type independent manner. It doesn't conform exactly
|
|
||||||
to either the GNU or POSIX standards, although it is close. See
|
|
||||||
docs/manual.html for descriptions of how things work or look at the
|
|
||||||
simple examples in the examples dir.
|
|
||||||
|
|
||||||
To find out what the latest changes are read the NEWS file in this
|
|
||||||
directory.
|
|
||||||
|
|
||||||
Any and all feedback is welcome at https://sf.net/p/tclap/discussion/
|
|
1134
src/external/tclap-1.2.5/aclocal.m4
vendored
1134
src/external/tclap-1.2.5/aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
7
src/external/tclap-1.2.5/config/Makefile.am
vendored
7
src/external/tclap-1.2.5/config/Makefile.am
vendored
@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
EXTRA_DIST = ac_cxx_have_sstream.m4\
|
|
||||||
ac_cxx_have_strstream.m4\
|
|
||||||
ac_cxx_namespaces.m4\
|
|
||||||
bb_enable_doxygen.m4
|
|
||||||
|
|
||||||
|
|
494
src/external/tclap-1.2.5/config/Makefile.in
vendored
494
src/external/tclap-1.2.5/config/Makefile.in
vendored
@ -1,494 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.16.4 from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
am__is_gnu_make = { \
|
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
|
||||||
false; \
|
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
am__make_running_with_option = \
|
|
||||||
case $${target_option-} in \
|
|
||||||
?) ;; \
|
|
||||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
|
||||||
"target option '$${target_option-}' specified" >&2; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
has_opt=no; \
|
|
||||||
sane_makeflags=$$MAKEFLAGS; \
|
|
||||||
if $(am__is_gnu_make); then \
|
|
||||||
sane_makeflags=$$MFLAGS; \
|
|
||||||
else \
|
|
||||||
case $$MAKEFLAGS in \
|
|
||||||
*\\[\ \ ]*) \
|
|
||||||
bs=\\; \
|
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
|
||||||
esac; \
|
|
||||||
fi; \
|
|
||||||
skip_next=no; \
|
|
||||||
strip_trailopt () \
|
|
||||||
{ \
|
|
||||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
|
||||||
}; \
|
|
||||||
for flg in $$sane_makeflags; do \
|
|
||||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
|
||||||
case $$flg in \
|
|
||||||
*=*|--*) continue;; \
|
|
||||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
|
||||||
-*I?*) strip_trailopt 'I';; \
|
|
||||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
|
||||||
-*O?*) strip_trailopt 'O';; \
|
|
||||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
|
||||||
-*l?*) strip_trailopt 'l';; \
|
|
||||||
-[dEDm]) skip_next=yes;; \
|
|
||||||
-[JT]) skip_next=yes;; \
|
|
||||||
esac; \
|
|
||||||
case $$flg in \
|
|
||||||
*$$target_option*) has_opt=yes; break;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
test $$has_opt = yes
|
|
||||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
|
||||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
subdir = config
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/config/ac_cxx_have_long_long.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_have_sstream.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_have_strstream.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_namespaces.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_warn_effective_cxx.m4 \
|
|
||||||
$(top_srcdir)/config/bb_enable_doxygen.m4 \
|
|
||||||
$(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|
||||||
$(ACLOCAL_M4)
|
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
|
||||||
CONFIG_HEADER = config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
|
||||||
AM_V_P = $(am__v_P_@AM_V@)
|
|
||||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
|
||||||
am__v_P_0 = false
|
|
||||||
am__v_P_1 = :
|
|
||||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
|
||||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
|
||||||
am__v_GEN_0 = @echo " GEN " $@;
|
|
||||||
am__v_GEN_1 =
|
|
||||||
AM_V_at = $(am__v_at_@AM_V@)
|
|
||||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|
||||||
am__v_at_0 = @
|
|
||||||
am__v_at_1 =
|
|
||||||
SOURCES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
|
|
||||||
config.h.in
|
|
||||||
# Read a list of newline-separated strings from the standard input,
|
|
||||||
# and print each of them once, without duplicates. Input order is
|
|
||||||
# *not* preserved.
|
|
||||||
am__uniquify_input = $(AWK) '\
|
|
||||||
BEGIN { nonempty = 0; } \
|
|
||||||
{ items[$$0] = 1; nonempty = 1; } \
|
|
||||||
END { if (nonempty) { for (i in items) print i; }; } \
|
|
||||||
'
|
|
||||||
# Make sure the list of sources is unique. This is necessary because,
|
|
||||||
# e.g., the same source file might be shared among _SOURCES variables
|
|
||||||
# for different programs/libraries.
|
|
||||||
am__define_uniq_tagged_files = \
|
|
||||||
list='$(am__tagged_files)'; \
|
|
||||||
unique=`for i in $$list; do \
|
|
||||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
|
||||||
done | $(am__uniquify_input)`
|
|
||||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in depcomp \
|
|
||||||
install-sh missing mkinstalldirs
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AWK = @AWK@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CSCOPE = @CSCOPE@
|
|
||||||
CTAGS = @CTAGS@
|
|
||||||
CXX = @CXX@
|
|
||||||
CXXDEPMODE = @CXXDEPMODE@
|
|
||||||
CXXFLAGS = @CXXFLAGS@
|
|
||||||
CYGPATH_W = @CYGPATH_W@
|
|
||||||
DEFS = @DEFS@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
DOT = @DOT@
|
|
||||||
DOXYGEN = @DOXYGEN@
|
|
||||||
ECHO_C = @ECHO_C@
|
|
||||||
ECHO_N = @ECHO_N@
|
|
||||||
ECHO_T = @ECHO_T@
|
|
||||||
ETAGS = @ETAGS@
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LIBOBJS = @LIBOBJS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
|
||||||
MAKEINFO = @MAKEINFO@
|
|
||||||
MKDIR_P = @MKDIR_P@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
SET_MAKE = @SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
WARN_EFFECTIVE_CXX = @WARN_EFFECTIVE_CXX@
|
|
||||||
WARN_NO_EFFECTIVE_CXX = @WARN_NO_EFFECTIVE_CXX@
|
|
||||||
abs_builddir = @abs_builddir@
|
|
||||||
abs_srcdir = @abs_srcdir@
|
|
||||||
abs_top_builddir = @abs_top_builddir@
|
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__leading_dot = @am__leading_dot@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
am__tar = @am__tar@
|
|
||||||
am__untar = @am__untar@
|
|
||||||
bindir = @bindir@
|
|
||||||
build_alias = @build_alias@
|
|
||||||
builddir = @builddir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
docdir = @docdir@
|
|
||||||
dvidir = @dvidir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
host_alias = @host_alias@
|
|
||||||
htmldir = @htmldir@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
libdir = @libdir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
localedir = @localedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
mandir = @mandir@
|
|
||||||
mkdir_p = @mkdir_p@
|
|
||||||
oldincludedir = @oldincludedir@
|
|
||||||
pdfdir = @pdfdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
program_transform_name = @program_transform_name@
|
|
||||||
psdir = @psdir@
|
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
target_alias = @target_alias@
|
|
||||||
top_build_prefix = @top_build_prefix@
|
|
||||||
top_builddir = @top_builddir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
EXTRA_DIST = ac_cxx_have_sstream.m4\
|
|
||||||
ac_cxx_have_strstream.m4\
|
|
||||||
ac_cxx_namespaces.m4\
|
|
||||||
bb_enable_doxygen.m4
|
|
||||||
|
|
||||||
all: config.h
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
|
||||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu config/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu config/Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: $(am__configure_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(am__aclocal_m4_deps):
|
|
||||||
|
|
||||||
config.h: stamp-h1
|
|
||||||
@test -f $@ || rm -f stamp-h1
|
|
||||||
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
|
|
||||||
|
|
||||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
|
||||||
@rm -f stamp-h1
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status config/config.h
|
|
||||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
|
||||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
|
||||||
rm -f stamp-h1
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
distclean-hdr:
|
|
||||||
-rm -f config.h stamp-h1
|
|
||||||
|
|
||||||
ID: $(am__tagged_files)
|
|
||||||
$(am__define_uniq_tagged_files); mkid -fID $$unique
|
|
||||||
tags: tags-am
|
|
||||||
TAGS: tags
|
|
||||||
|
|
||||||
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|
||||||
set x; \
|
|
||||||
here=`pwd`; \
|
|
||||||
$(am__define_uniq_tagged_files); \
|
|
||||||
shift; \
|
|
||||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
|
||||||
test -n "$$unique" || unique=$$empty_fix; \
|
|
||||||
if test $$# -gt 0; then \
|
|
||||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|
||||||
"$$@" $$unique; \
|
|
||||||
else \
|
|
||||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
|
||||||
$$unique; \
|
|
||||||
fi; \
|
|
||||||
fi
|
|
||||||
ctags: ctags-am
|
|
||||||
|
|
||||||
CTAGS: ctags
|
|
||||||
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
|
|
||||||
$(am__define_uniq_tagged_files); \
|
|
||||||
test -z "$(CTAGS_ARGS)$$unique" \
|
|
||||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
|
||||||
$$unique
|
|
||||||
|
|
||||||
GTAGS:
|
|
||||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
|
||||||
&& $(am__cd) $(top_srcdir) \
|
|
||||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
|
||||||
cscopelist: cscopelist-am
|
|
||||||
|
|
||||||
cscopelist-am: $(am__tagged_files)
|
|
||||||
list='$(am__tagged_files)'; \
|
|
||||||
case "$(srcdir)" in \
|
|
||||||
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
|
|
||||||
*) sdir=$(subdir)/$(srcdir) ;; \
|
|
||||||
esac; \
|
|
||||||
for i in $$list; do \
|
|
||||||
if test -f "$$i"; then \
|
|
||||||
echo "$(subdir)/$$i"; \
|
|
||||||
else \
|
|
||||||
echo "$$sdir/$$i"; \
|
|
||||||
fi; \
|
|
||||||
done >> $(top_builddir)/cscope.files
|
|
||||||
|
|
||||||
distclean-tags:
|
|
||||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
|
||||||
distdir: $(BUILT_SOURCES)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
list='$(DISTFILES)'; \
|
|
||||||
dist_files=`for file in $$list; do echo $$file; done | \
|
|
||||||
sed -e "s|^$$srcdirstrip/||;t" \
|
|
||||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|
||||||
case $$dist_files in \
|
|
||||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|
||||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|
||||||
sort -u` ;; \
|
|
||||||
esac; \
|
|
||||||
for file in $$dist_files; do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test -d "$(distdir)/$$file"; then \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|
||||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
else \
|
|
||||||
test -f "$(distdir)/$$file" \
|
|
||||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile config.h
|
|
||||||
installdirs:
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
if test -z '$(STRIP)'; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
install; \
|
|
||||||
else \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|
||||||
fi
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
|
||||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
install-dvi: install-dvi-am
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-am
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-am
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-am
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic
|
|
||||||
|
|
||||||
pdf: pdf-am
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-am
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am:
|
|
||||||
|
|
||||||
.MAKE: all install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
|
|
||||||
cscopelist-am ctags ctags-am distclean distclean-generic \
|
|
||||||
distclean-hdr distclean-tags distdir dvi dvi-am html html-am \
|
|
||||||
info info-am install install-am install-data install-data-am \
|
|
||||||
install-dvi install-dvi-am install-exec install-exec-am \
|
|
||||||
install-html install-html-am install-info install-info-am \
|
|
||||||
install-man install-pdf install-pdf-am install-ps \
|
|
||||||
install-ps-am install-strip installcheck installcheck-am \
|
|
||||||
installdirs maintainer-clean maintainer-clean-generic \
|
|
||||||
mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
|
|
||||||
tags-am uninstall uninstall-am
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
@ -1,19 +0,0 @@
|
|||||||
dnl @synopsis AC_CXX_HAVE_LONG_LONG
|
|
||||||
dnl
|
|
||||||
dnl If the C++ implementation have a long long type
|
|
||||||
dnl
|
|
||||||
AC_DEFUN([AC_CXX_HAVE_LONG_LONG],
|
|
||||||
[AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_TRY_COMPILE([],[long long x = 1; return 0;],
|
|
||||||
ac_cv_cxx_have_long_long=yes, ac_cv_cxx_have_long_long=no)
|
|
||||||
|
|
||||||
if test "$ac_cv_cxx_have_long_long" = yes; then
|
|
||||||
AC_DEFINE(HAVE_LONG_LONG, 1,
|
|
||||||
[define if the C++ implementation have long long])
|
|
||||||
else
|
|
||||||
AC_DEFINE(HAVE_LONG_LONG, 0,
|
|
||||||
[define if the C++ implementation have long long])
|
|
||||||
fi
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
@ -1,25 +0,0 @@
|
|||||||
dnl @synopsis AC_CXX_HAVE_SSTREAM
|
|
||||||
dnl
|
|
||||||
dnl If the C++ library has a working stringstream, define HAVE_SSTREAM.
|
|
||||||
dnl
|
|
||||||
dnl @author Ben Stanley
|
|
||||||
dnl @version $Id: ac_cxx_have_sstream.m4,v 1.2 2006/02/22 02:10:28 zeekec Exp $
|
|
||||||
dnl
|
|
||||||
AC_DEFUN([AC_CXX_HAVE_SSTREAM],
|
|
||||||
[AC_REQUIRE([AC_CXX_NAMESPACES])
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_CHECK_HEADERS(sstream)
|
|
||||||
AC_CACHE_CHECK([whether the STL defines stringstream],
|
|
||||||
[ac_cv_cxx_have_sstream],
|
|
||||||
[AC_TRY_COMPILE([#include <sstream>
|
|
||||||
#ifdef HAVE_NAMESPACES
|
|
||||||
using namespace std;
|
|
||||||
#endif],[stringstream message; message << "Hello"; return 0;],
|
|
||||||
ac_cv_cxx_have_sstream=yes, ac_cv_cxx_have_sstream=no)
|
|
||||||
])
|
|
||||||
if test "$ac_cv_cxx_have_sstream" = yes; then
|
|
||||||
AC_DEFINE(HAVE_SSTREAM,1,[define if the compiler has stringstream])
|
|
||||||
fi
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
@ -1,28 +0,0 @@
|
|||||||
dnl @synopsis AC_CXX_HAVE_STRSTREAM
|
|
||||||
dnl
|
|
||||||
dnl If the C++ library has a working strstream, define HAVE_CLASS_STRSTREAM.
|
|
||||||
dnl
|
|
||||||
dnl Adapted from ac_cxx_have_sstream.m4 by Steve Robbins
|
|
||||||
dnl
|
|
||||||
AC_DEFUN([AC_CXX_HAVE_STRSTREAM],
|
|
||||||
[AC_REQUIRE([AC_CXX_NAMESPACES])
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_CHECK_HEADERS(strstream)
|
|
||||||
AC_CACHE_CHECK([whether the STL defines strstream],
|
|
||||||
[ac_cv_cxx_have_class_strstream],
|
|
||||||
[AC_TRY_COMPILE([#if HAVE_STRSTREAM
|
|
||||||
# include <strstream>
|
|
||||||
#else
|
|
||||||
# include <strstream.h>
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_NAMESPACES
|
|
||||||
using namespace std;
|
|
||||||
#endif],[ostrstream message; message << "Hello"; return 0;],
|
|
||||||
ac_cv_cxx_have_class_strstream=yes, ac_cv_cxx_have_class_strstream=no)
|
|
||||||
])
|
|
||||||
if test "$ac_cv_cxx_have_class_strstream" = yes; then
|
|
||||||
AC_DEFINE(HAVE_CLASS_STRSTREAM,1,[define if the library defines strstream])
|
|
||||||
fi
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
@ -1,22 +0,0 @@
|
|||||||
dnl @synopsis AC_CXX_NAMESPACES
|
|
||||||
dnl
|
|
||||||
dnl If the compiler can prevent names clashes using namespaces, define
|
|
||||||
dnl HAVE_NAMESPACES.
|
|
||||||
dnl
|
|
||||||
dnl @version $Id: ac_cxx_namespaces.m4,v 1.1 2003/03/19 02:40:00 mes5k Exp $
|
|
||||||
dnl @author Luc Maisonobe
|
|
||||||
dnl
|
|
||||||
AC_DEFUN([AC_CXX_NAMESPACES],
|
|
||||||
[AC_CACHE_CHECK(whether the compiler implements namespaces,
|
|
||||||
ac_cv_cxx_namespaces,
|
|
||||||
[AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}],
|
|
||||||
[using namespace Outer::Inner; return i;],
|
|
||||||
ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no)
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
||||||
if test "$ac_cv_cxx_namespaces" = yes; then
|
|
||||||
AC_DEFINE(HAVE_NAMESPACES,1,[define to 1 if the compiler implements namespaces])
|
|
||||||
fi
|
|
||||||
])
|
|
@ -1,31 +0,0 @@
|
|||||||
dnl HAVE_WARN_EFFECTIVE_CXX
|
|
||||||
dnl ----------------------
|
|
||||||
dnl
|
|
||||||
dnl If the C++ compiler accepts the `-Weffc++' flag,
|
|
||||||
dnl set output variable `WARN_EFFECTIVE_CXX' to `-Weffc++' and
|
|
||||||
dnl `WARN_NO_EFFECTIVE_CXX' to `-Wno-effc++'. Otherwise,
|
|
||||||
dnl leave both empty.
|
|
||||||
dnl
|
|
||||||
AC_DEFUN([HAVE_WARN_EFFECTIVE_CXX],
|
|
||||||
[
|
|
||||||
AC_REQUIRE([AC_PROG_CXX])
|
|
||||||
AC_MSG_CHECKING([whether the C++ compiler (${CXX}) accepts -Weffc++])
|
|
||||||
AC_CACHE_VAL([_cv_warn_effective_cxx],
|
|
||||||
[
|
|
||||||
AC_LANG_SAVE
|
|
||||||
AC_LANG_CPLUSPLUS
|
|
||||||
save_cxxflags="$CXXFLAGS"
|
|
||||||
CXXFLAGS="$CXXFLAGS -Weffc++"
|
|
||||||
AC_TRY_COMPILE([],[main();],
|
|
||||||
[_cv_warn_effective_cxx=yes], [_cv_warn_effective_cxx=no])
|
|
||||||
CXXFLAGS="$save_cxxflags"
|
|
||||||
AC_LANG_RESTORE
|
|
||||||
])
|
|
||||||
AC_MSG_RESULT([$_cv_warn_effective_cxx])
|
|
||||||
if test "$_cv_warn_effective_cxx" = yes; then
|
|
||||||
WARN_EFFECTIVE_CXX=-Weffc++
|
|
||||||
WARN_NO_EFFECTIVE_CXX=-Wno-effc++
|
|
||||||
fi
|
|
||||||
AC_SUBST([WARN_EFFECTIVE_CXX])
|
|
||||||
AC_SUBST([WARN_NO_EFFECTIVE_CXX])
|
|
||||||
])
|
|
@ -1,18 +0,0 @@
|
|||||||
AC_DEFUN([BB_ENABLE_DOXYGEN],
|
|
||||||
[
|
|
||||||
AC_ARG_ENABLE(doxygen, [--enable-doxygen enable documentation generation with doxygen (auto)])
|
|
||||||
if test "x$enable_doxygen" = xno; then
|
|
||||||
enable_doc=no
|
|
||||||
else
|
|
||||||
AC_PATH_PROG(DOXYGEN, doxygen, , $PATH)
|
|
||||||
if test x$DOXYGEN = x; then
|
|
||||||
if test "x$enable_doxygen" = xyes; then
|
|
||||||
AC_MSG_ERROR([could not find doxygen])
|
|
||||||
fi
|
|
||||||
enable_doc=no
|
|
||||||
else
|
|
||||||
enable_doc=yes
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
AM_CONDITIONAL(DOC, test x$enable_doc = xyes)
|
|
||||||
])
|
|
72
src/external/tclap-1.2.5/config/config.h.in
vendored
72
src/external/tclap-1.2.5/config/config.h.in
vendored
@ -1,72 +0,0 @@
|
|||||||
/* config/config.h.in. Generated from configure.ac by autoheader. */
|
|
||||||
|
|
||||||
/* define if the library defines strstream */
|
|
||||||
#undef HAVE_CLASS_STRSTREAM
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
|
||||||
#undef HAVE_INTTYPES_H
|
|
||||||
|
|
||||||
/* define if the C++ implementation have long long */
|
|
||||||
#undef HAVE_LONG_LONG
|
|
||||||
|
|
||||||
/* define to 1 if the compiler implements namespaces */
|
|
||||||
#undef HAVE_NAMESPACES
|
|
||||||
|
|
||||||
/* define if the compiler has stringstream */
|
|
||||||
#undef HAVE_SSTREAM
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdio.h> header file. */
|
|
||||||
#undef HAVE_STDIO_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#undef HAVE_STDLIB_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strings.h> header file. */
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <strstream> header file. */
|
|
||||||
#undef HAVE_STRSTREAM
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
|
||||||
#undef HAVE_SYS_STAT_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
|
||||||
#undef HAVE_SYS_TYPES_H
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
|
||||||
#undef HAVE_UNISTD_H
|
|
||||||
|
|
||||||
/* Name of package */
|
|
||||||
#undef PACKAGE
|
|
||||||
|
|
||||||
/* Define to the address where bug reports for this package should be sent. */
|
|
||||||
#undef PACKAGE_BUGREPORT
|
|
||||||
|
|
||||||
/* Define to the full name of this package. */
|
|
||||||
#undef PACKAGE_NAME
|
|
||||||
|
|
||||||
/* Define to the full name and version of this package. */
|
|
||||||
#undef PACKAGE_STRING
|
|
||||||
|
|
||||||
/* Define to the one symbol short name of this package. */
|
|
||||||
#undef PACKAGE_TARNAME
|
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
|
||||||
#undef PACKAGE_URL
|
|
||||||
|
|
||||||
/* Define to the version of this package. */
|
|
||||||
#undef PACKAGE_VERSION
|
|
||||||
|
|
||||||
/* Define to 1 if all of the C90 standard headers exist (not just the ones
|
|
||||||
required in a freestanding environment). This macro is provided for
|
|
||||||
backward compatibility; new code need not use it. */
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
|
|
||||||
/* Version number of package */
|
|
||||||
#undef VERSION
|
|
411
src/external/tclap-1.2.5/config/depcomp
vendored
411
src/external/tclap-1.2.5/config/depcomp
vendored
@ -1,411 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
|
|
||||||
# depcomp - compile a program generating dependencies as side-effects
|
|
||||||
# Copyright 1999, 2000 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
# 02111-1307, USA.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
|
||||||
|
|
||||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
|
||||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# `libtool' can also be set to `yes' or `no'.
|
|
||||||
|
|
||||||
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
|
|
||||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
|
||||||
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
|
|
||||||
# Some modes work just like other modes, but use different flags. We
|
|
||||||
# parameterize here, but still list the modes in the big case below,
|
|
||||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
|
||||||
# here, because this file can only contain one case statement.
|
|
||||||
if test "$depmode" = hp; then
|
|
||||||
# HP compiler uses -M and no extra arg.
|
|
||||||
gccflag=-M
|
|
||||||
depmode=gcc
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$depmode" = dashXmstdout; then
|
|
||||||
# This is just like dashmstdout with a different argument.
|
|
||||||
dashmflag=-xM
|
|
||||||
depmode=dashmstdout
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$depmode" in
|
|
||||||
gcc3)
|
|
||||||
## gcc 3 implements dependency tracking that does exactly what
|
|
||||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
|
||||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
|
||||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
|
||||||
stat=$?
|
|
||||||
if test $stat -eq 0; then :
|
|
||||||
else
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
mv "$tmpdepfile" "$depfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
gcc)
|
|
||||||
## There are various ways to get dependency output from gcc. Here's
|
|
||||||
## why we pick this rather obscure method:
|
|
||||||
## - Don't want to use -MD because we'd like the dependencies to end
|
|
||||||
## up in a subdir. Having to rename by hand is ugly.
|
|
||||||
## (We might end up doing this anyway to support other compilers.)
|
|
||||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
|
||||||
## -MM, not -M (despite what the docs say).
|
|
||||||
## - Using -M directly means running the compiler twice (even worse
|
|
||||||
## than renaming).
|
|
||||||
if test -z "$gccflag"; then
|
|
||||||
gccflag=-MD,
|
|
||||||
fi
|
|
||||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
|
||||||
stat=$?
|
|
||||||
if test $stat -eq 0; then :
|
|
||||||
else
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
|
||||||
## The second -e expression handles DOS-style file names with drive letters.
|
|
||||||
sed -e 's/^[^:]*: / /' \
|
|
||||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
|
||||||
## This next piece of magic avoids the `deleted header file' problem.
|
|
||||||
## The problem is that when a header file which appears in a .P file
|
|
||||||
## is deleted, the dependency causes make to die (because there is
|
|
||||||
## typically no way to rebuild the header). We avoid this by adding
|
|
||||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
|
||||||
## this for us directly.
|
|
||||||
tr ' ' '
|
|
||||||
' < "$tmpdepfile" |
|
|
||||||
## Some versions of gcc put a space before the `:'. On the theory
|
|
||||||
## that the space means something, we add a space to the output as
|
|
||||||
## well.
|
|
||||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
|
||||||
## correctly. Breaking it into two sed invocations is a workaround.
|
|
||||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
hp)
|
|
||||||
# This case exists only to let depend.m4 do its work. It works by
|
|
||||||
# looking at the text of this script. This case will never be run,
|
|
||||||
# since it is checked for above.
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
sgi)
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
|
||||||
else
|
|
||||||
"$@" -MDupdate "$tmpdepfile"
|
|
||||||
fi
|
|
||||||
stat=$?
|
|
||||||
if test $stat -eq 0; then :
|
|
||||||
else
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
|
|
||||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
|
|
||||||
# Clip off the initial element (the dependent). Don't try to be
|
|
||||||
# clever and replace this with sed code, as IRIX sed won't handle
|
|
||||||
# lines with more than a fixed number of characters (4096 in
|
|
||||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
|
||||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
|
||||||
# dependency line.
|
|
||||||
tr ' ' '
|
|
||||||
' < "$tmpdepfile" \
|
|
||||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
|
||||||
tr '
|
|
||||||
' ' ' >> $depfile
|
|
||||||
echo >> $depfile
|
|
||||||
|
|
||||||
# The second pass generates a dummy entry for each header file.
|
|
||||||
tr ' ' '
|
|
||||||
' < "$tmpdepfile" \
|
|
||||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
|
||||||
>> $depfile
|
|
||||||
else
|
|
||||||
# The sourcefile does not contain any dependencies, so just
|
|
||||||
# store a dummy comment line, to avoid errors with the Makefile
|
|
||||||
# "include basename.Plo" scheme.
|
|
||||||
echo "#dummy" > "$depfile"
|
|
||||||
fi
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
aix)
|
|
||||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
|
||||||
# in a .u file. This file always lives in the current directory.
|
|
||||||
# Also, the AIX compiler puts `$object:' at the start of each line;
|
|
||||||
# $object doesn't have directory information.
|
|
||||||
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
|
|
||||||
tmpdepfile="$stripped.u"
|
|
||||||
outname="$stripped.o"
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
"$@" -Wc,-M
|
|
||||||
else
|
|
||||||
"$@" -M
|
|
||||||
fi
|
|
||||||
|
|
||||||
stat=$?
|
|
||||||
if test $stat -eq 0; then :
|
|
||||||
else
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -f "$tmpdepfile"; then
|
|
||||||
# Each line is of the form `foo.o: dependent.h'.
|
|
||||||
# Do two passes, one to just change these to
|
|
||||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
|
||||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
|
||||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
|
||||||
else
|
|
||||||
# The sourcefile does not contain any dependencies, so just
|
|
||||||
# store a dummy comment line, to avoid errors with the Makefile
|
|
||||||
# "include basename.Plo" scheme.
|
|
||||||
echo "#dummy" > "$depfile"
|
|
||||||
fi
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
tru64)
|
|
||||||
# The Tru64 AIX compiler uses -MD to generate dependencies as a side
|
|
||||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
|
||||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
|
||||||
# dependencies in `foo.d' instead, so we check for that too.
|
|
||||||
# Subdirectories are respected.
|
|
||||||
|
|
||||||
tmpdepfile1="$object.d"
|
|
||||||
tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
|
|
||||||
if test "$libtool" = yes; then
|
|
||||||
"$@" -Wc,-MD
|
|
||||||
else
|
|
||||||
"$@" -MD
|
|
||||||
fi
|
|
||||||
|
|
||||||
stat=$?
|
|
||||||
if test $stat -eq 0; then :
|
|
||||||
else
|
|
||||||
rm -f "$tmpdepfile1" "$tmpdepfile2"
|
|
||||||
exit $stat
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -f "$tmpdepfile1"; then
|
|
||||||
tmpdepfile="$tmpdepfile1"
|
|
||||||
else
|
|
||||||
tmpdepfile="$tmpdepfile2"
|
|
||||||
fi
|
|
||||||
if test -f "$tmpdepfile"; then
|
|
||||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
|
||||||
# That's a space and a tab in the [].
|
|
||||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
|
||||||
else
|
|
||||||
echo "#dummy" > "$depfile"
|
|
||||||
fi
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
#nosideeffect)
|
|
||||||
# This comment above is used by automake to tell side-effect
|
|
||||||
# dependency tracking mechanisms from slower ones.
|
|
||||||
|
|
||||||
dashmstdout)
|
|
||||||
# Important note: in order to support this mode, a compiler *must*
|
|
||||||
# always write the proprocessed file to stdout, regardless of -o,
|
|
||||||
# because we must use -o when running libtool.
|
|
||||||
test -z "$dashmflag" && dashmflag=-M
|
|
||||||
( IFS=" "
|
|
||||||
case " $* " in
|
|
||||||
*" --mode=compile "*) # this is libtool, let us make it quiet
|
|
||||||
for arg
|
|
||||||
do # cycle over the arguments
|
|
||||||
case "$arg" in
|
|
||||||
"--mode=compile")
|
|
||||||
# insert --quiet before "--mode=compile"
|
|
||||||
set fnord "$@" --quiet
|
|
||||||
shift # fnord
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
set fnord "$@" "$arg"
|
|
||||||
shift # fnord
|
|
||||||
shift # "$arg"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
|
||||||
) &
|
|
||||||
proc=$!
|
|
||||||
"$@"
|
|
||||||
stat=$?
|
|
||||||
wait "$proc"
|
|
||||||
if test "$stat" != 0; then exit $stat; fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
cat < "$tmpdepfile" > "$depfile"
|
|
||||||
tr ' ' '
|
|
||||||
' < "$tmpdepfile" | \
|
|
||||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
|
||||||
## correctly. Breaking it into two sed invocations is a workaround.
|
|
||||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
dashXmstdout)
|
|
||||||
# This case only exists to satisfy depend.m4. It is never actually
|
|
||||||
# run, as this mode is specially recognized in the preamble.
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
makedepend)
|
|
||||||
# X makedepend
|
|
||||||
(
|
|
||||||
shift
|
|
||||||
cleared=no
|
|
||||||
for arg in "$@"; do
|
|
||||||
case $cleared in no)
|
|
||||||
set ""; shift
|
|
||||||
cleared=yes
|
|
||||||
esac
|
|
||||||
case "$arg" in
|
|
||||||
-D*|-I*)
|
|
||||||
set fnord "$@" "$arg"; shift;;
|
|
||||||
-*)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
set fnord "$@" "$arg"; shift;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
|
||||||
touch "$tmpdepfile"
|
|
||||||
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
|
||||||
) &
|
|
||||||
proc=$!
|
|
||||||
"$@"
|
|
||||||
stat=$?
|
|
||||||
wait "$proc"
|
|
||||||
if test "$stat" != 0; then exit $stat; fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
cat < "$tmpdepfile" > "$depfile"
|
|
||||||
tail +3 "$tmpdepfile" | tr ' ' '
|
|
||||||
' | \
|
|
||||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
|
||||||
## correctly. Breaking it into two sed invocations is a workaround.
|
|
||||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
|
||||||
;;
|
|
||||||
|
|
||||||
cpp)
|
|
||||||
# Important note: in order to support this mode, a compiler *must*
|
|
||||||
# always write the proprocessed file to stdout, regardless of -o,
|
|
||||||
# because we must use -o when running libtool.
|
|
||||||
( IFS=" "
|
|
||||||
case " $* " in
|
|
||||||
*" --mode=compile "*)
|
|
||||||
for arg
|
|
||||||
do # cycle over the arguments
|
|
||||||
case $arg in
|
|
||||||
"--mode=compile")
|
|
||||||
# insert --quiet before "--mode=compile"
|
|
||||||
set fnord "$@" --quiet
|
|
||||||
shift # fnord
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
set fnord "$@" "$arg"
|
|
||||||
shift # fnord
|
|
||||||
shift # "$arg"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
"$@" -E |
|
|
||||||
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
|
||||||
sed '$ s: \\$::' > "$tmpdepfile"
|
|
||||||
) &
|
|
||||||
proc=$!
|
|
||||||
"$@"
|
|
||||||
stat=$?
|
|
||||||
wait "$proc"
|
|
||||||
if test "$stat" != 0; then exit $stat; fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
cat < "$tmpdepfile" >> "$depfile"
|
|
||||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
msvisualcpp)
|
|
||||||
# Important note: in order to support this mode, a compiler *must*
|
|
||||||
# always write the proprocessed file to stdout, regardless of -o,
|
|
||||||
# because we must use -o when running libtool.
|
|
||||||
( IFS=" "
|
|
||||||
case " $* " in
|
|
||||||
*" --mode=compile "*)
|
|
||||||
for arg
|
|
||||||
do # cycle over the arguments
|
|
||||||
case $arg in
|
|
||||||
"--mode=compile")
|
|
||||||
# insert --quiet before "--mode=compile"
|
|
||||||
set fnord "$@" --quiet
|
|
||||||
shift # fnord
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
set fnord "$@" "$arg"
|
|
||||||
shift # fnord
|
|
||||||
shift # "$arg"
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
"$@" -E |
|
|
||||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
|
||||||
) &
|
|
||||||
proc=$!
|
|
||||||
"$@"
|
|
||||||
stat=$?
|
|
||||||
wait "$proc"
|
|
||||||
if test "$stat" != 0; then exit $stat; fi
|
|
||||||
rm -f "$depfile"
|
|
||||||
echo "$object : \\" > "$depfile"
|
|
||||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
|
||||||
echo " " >> "$depfile"
|
|
||||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
|
||||||
rm -f "$tmpdepfile"
|
|
||||||
;;
|
|
||||||
|
|
||||||
none)
|
|
||||||
exec "$@"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Unknown depmode $depmode" 1>&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
251
src/external/tclap-1.2.5/config/install-sh
vendored
251
src/external/tclap-1.2.5/config/install-sh
vendored
@ -1,251 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# install - install a program, script, or datafile
|
|
||||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
|
||||||
#
|
|
||||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
|
||||||
#
|
|
||||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
|
||||||
# documentation for any purpose is hereby granted without fee, provided that
|
|
||||||
# the above copyright notice appear in all copies and that both that
|
|
||||||
# copyright notice and this permission notice appear in supporting
|
|
||||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
|
||||||
# publicity pertaining to distribution of the software without specific,
|
|
||||||
# written prior permission. M.I.T. makes no representations about the
|
|
||||||
# suitability of this software for any purpose. It is provided "as is"
|
|
||||||
# without express or implied warranty.
|
|
||||||
#
|
|
||||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
|
||||||
# `make' implicit rules from creating a file called install from it
|
|
||||||
# when there is no Makefile.
|
|
||||||
#
|
|
||||||
# This script is compatible with the BSD install script, but was written
|
|
||||||
# from scratch. It can only install one file at a time, a restriction
|
|
||||||
# shared with many OS's install programs.
|
|
||||||
|
|
||||||
|
|
||||||
# set DOITPROG to echo to test this script
|
|
||||||
|
|
||||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
|
||||||
doit="${DOITPROG-}"
|
|
||||||
|
|
||||||
|
|
||||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
|
||||||
|
|
||||||
mvprog="${MVPROG-mv}"
|
|
||||||
cpprog="${CPPROG-cp}"
|
|
||||||
chmodprog="${CHMODPROG-chmod}"
|
|
||||||
chownprog="${CHOWNPROG-chown}"
|
|
||||||
chgrpprog="${CHGRPPROG-chgrp}"
|
|
||||||
stripprog="${STRIPPROG-strip}"
|
|
||||||
rmprog="${RMPROG-rm}"
|
|
||||||
mkdirprog="${MKDIRPROG-mkdir}"
|
|
||||||
|
|
||||||
transformbasename=""
|
|
||||||
transform_arg=""
|
|
||||||
instcmd="$mvprog"
|
|
||||||
chmodcmd="$chmodprog 0755"
|
|
||||||
chowncmd=""
|
|
||||||
chgrpcmd=""
|
|
||||||
stripcmd=""
|
|
||||||
rmcmd="$rmprog -f"
|
|
||||||
mvcmd="$mvprog"
|
|
||||||
src=""
|
|
||||||
dst=""
|
|
||||||
dir_arg=""
|
|
||||||
|
|
||||||
while [ x"$1" != x ]; do
|
|
||||||
case $1 in
|
|
||||||
-c) instcmd="$cpprog"
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-d) dir_arg=true
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-m) chmodcmd="$chmodprog $2"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-o) chowncmd="$chownprog $2"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-g) chgrpcmd="$chgrpprog $2"
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-s) stripcmd="$stripprog"
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
|
|
||||||
*) if [ x"$src" = x ]
|
|
||||||
then
|
|
||||||
src=$1
|
|
||||||
else
|
|
||||||
# this colon is to work around a 386BSD /bin/sh bug
|
|
||||||
:
|
|
||||||
dst=$1
|
|
||||||
fi
|
|
||||||
shift
|
|
||||||
continue;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ x"$src" = x ]
|
|
||||||
then
|
|
||||||
echo "install: no input file specified"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ x"$dir_arg" != x ]; then
|
|
||||||
dst=$src
|
|
||||||
src=""
|
|
||||||
|
|
||||||
if [ -d $dst ]; then
|
|
||||||
instcmd=:
|
|
||||||
chmodcmd=""
|
|
||||||
else
|
|
||||||
instcmd=mkdir
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
|
|
||||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
|
||||||
# might cause directories to be created, which would be especially bad
|
|
||||||
# if $src (and thus $dsttmp) contains '*'.
|
|
||||||
|
|
||||||
if [ -f $src -o -d $src ]
|
|
||||||
then
|
|
||||||
true
|
|
||||||
else
|
|
||||||
echo "install: $src does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ x"$dst" = x ]
|
|
||||||
then
|
|
||||||
echo "install: no destination specified"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If destination is a directory, append the input filename; if your system
|
|
||||||
# does not like double slashes in filenames, you may need to add some logic
|
|
||||||
|
|
||||||
if [ -d $dst ]
|
|
||||||
then
|
|
||||||
dst="$dst"/`basename $src`
|
|
||||||
else
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
## this sed command emulates the dirname command
|
|
||||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
|
||||||
|
|
||||||
# Make sure that the destination directory exists.
|
|
||||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
|
||||||
|
|
||||||
# Skip lots of stat calls in the usual case.
|
|
||||||
if [ ! -d "$dstdir" ]; then
|
|
||||||
defaultIFS='
|
|
||||||
'
|
|
||||||
IFS="${IFS-${defaultIFS}}"
|
|
||||||
|
|
||||||
oIFS="${IFS}"
|
|
||||||
# Some sh's can't handle IFS=/ for some reason.
|
|
||||||
IFS='%'
|
|
||||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
|
||||||
IFS="${oIFS}"
|
|
||||||
|
|
||||||
pathcomp=''
|
|
||||||
|
|
||||||
while [ $# -ne 0 ] ; do
|
|
||||||
pathcomp="${pathcomp}${1}"
|
|
||||||
shift
|
|
||||||
|
|
||||||
if [ ! -d "${pathcomp}" ] ;
|
|
||||||
then
|
|
||||||
$mkdirprog "${pathcomp}"
|
|
||||||
else
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
|
|
||||||
pathcomp="${pathcomp}/"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ x"$dir_arg" != x ]
|
|
||||||
then
|
|
||||||
$doit $instcmd $dst &&
|
|
||||||
|
|
||||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
|
||||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
|
||||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
|
||||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
|
||||||
else
|
|
||||||
|
|
||||||
# If we're going to rename the final executable, determine the name now.
|
|
||||||
|
|
||||||
if [ x"$transformarg" = x ]
|
|
||||||
then
|
|
||||||
dstfile=`basename $dst`
|
|
||||||
else
|
|
||||||
dstfile=`basename $dst $transformbasename |
|
|
||||||
sed $transformarg`$transformbasename
|
|
||||||
fi
|
|
||||||
|
|
||||||
# don't allow the sed command to completely eliminate the filename
|
|
||||||
|
|
||||||
if [ x"$dstfile" = x ]
|
|
||||||
then
|
|
||||||
dstfile=`basename $dst`
|
|
||||||
else
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Make a temp file name in the proper directory.
|
|
||||||
|
|
||||||
dsttmp=$dstdir/#inst.$$#
|
|
||||||
|
|
||||||
# Move or copy the file name to the temp name
|
|
||||||
|
|
||||||
$doit $instcmd $src $dsttmp &&
|
|
||||||
|
|
||||||
trap "rm -f ${dsttmp}" 0 &&
|
|
||||||
|
|
||||||
# and set any options; do chmod last to preserve setuid bits
|
|
||||||
|
|
||||||
# If any of these fail, we abort the whole thing. If we want to
|
|
||||||
# ignore errors from any of these, just make sure not to ignore
|
|
||||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
|
||||||
|
|
||||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
|
||||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
|
||||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
|
||||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
|
||||||
|
|
||||||
# Now rename the file to the real destination.
|
|
||||||
|
|
||||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
|
||||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
|
||||||
|
|
||||||
fi &&
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
|
283
src/external/tclap-1.2.5/config/missing
vendored
283
src/external/tclap-1.2.5/config/missing
vendored
@ -1,283 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# Common stub for a few missing GNU programs while installing.
|
|
||||||
# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
|
|
||||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
|
||||||
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program; if not, write to the Free Software
|
|
||||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
||||||
# 02111-1307, USA.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
if test $# -eq 0; then
|
|
||||||
echo 1>&2 "Try \`$0 --help' for more information"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
run=:
|
|
||||||
|
|
||||||
# In the cases where this matters, `missing' is being run in the
|
|
||||||
# srcdir already.
|
|
||||||
if test -f configure.ac; then
|
|
||||||
configure_ac=configure.ac
|
|
||||||
else
|
|
||||||
configure_ac=configure.in
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
--run)
|
|
||||||
# Try to run requested program, and just exit if it succeeds.
|
|
||||||
run=
|
|
||||||
shift
|
|
||||||
"$@" && exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# If it does not exist, or fails to run (possibly an outdated version),
|
|
||||||
# try to emulate it.
|
|
||||||
case "$1" in
|
|
||||||
|
|
||||||
-h|--h|--he|--hel|--help)
|
|
||||||
echo "\
|
|
||||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
|
||||||
|
|
||||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
|
||||||
error status if there is no known handling for PROGRAM.
|
|
||||||
|
|
||||||
Options:
|
|
||||||
-h, --help display this help and exit
|
|
||||||
-v, --version output version information and exit
|
|
||||||
--run try to run the given command, and emulate it if it fails
|
|
||||||
|
|
||||||
Supported PROGRAM values:
|
|
||||||
aclocal touch file \`aclocal.m4'
|
|
||||||
autoconf touch file \`configure'
|
|
||||||
autoheader touch file \`config.h.in'
|
|
||||||
automake touch all \`Makefile.in' files
|
|
||||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
|
||||||
flex create \`lex.yy.c', if possible, from existing .c
|
|
||||||
help2man touch the output file
|
|
||||||
lex create \`lex.yy.c', if possible, from existing .c
|
|
||||||
makeinfo touch the output file
|
|
||||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
|
||||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
|
||||||
;;
|
|
||||||
|
|
||||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
|
||||||
echo "missing 0.3 - GNU automake"
|
|
||||||
;;
|
|
||||||
|
|
||||||
-*)
|
|
||||||
echo 1>&2 "$0: Unknown \`$1' option"
|
|
||||||
echo 1>&2 "Try \`$0 --help' for more information"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
aclocal)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
|
||||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
|
||||||
any GNU archive site."
|
|
||||||
touch aclocal.m4
|
|
||||||
;;
|
|
||||||
|
|
||||||
autoconf)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`${configure_ac}'. You might want to install the
|
|
||||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
|
||||||
archive site."
|
|
||||||
touch configure
|
|
||||||
;;
|
|
||||||
|
|
||||||
autoheader)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
|
||||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
|
||||||
from any GNU archive site."
|
|
||||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
|
||||||
test -z "$files" && files="config.h"
|
|
||||||
touch_files=
|
|
||||||
for f in $files; do
|
|
||||||
case "$f" in
|
|
||||||
*:*) touch_files="$touch_files "`echo "$f" |
|
|
||||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
|
||||||
*) touch_files="$touch_files $f.in";;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
touch $touch_files
|
|
||||||
;;
|
|
||||||
|
|
||||||
automake)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
|
||||||
You might want to install the \`Automake' and \`Perl' packages.
|
|
||||||
Grab them from any GNU archive site."
|
|
||||||
find . -type f -name Makefile.am -print |
|
|
||||||
sed 's/\.am$/.in/' |
|
|
||||||
while read f; do touch "$f"; done
|
|
||||||
;;
|
|
||||||
|
|
||||||
bison|yacc)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a \`.y' file. You may need the \`Bison' package
|
|
||||||
in order for those modifications to take effect. You can get
|
|
||||||
\`Bison' from any GNU archive site."
|
|
||||||
rm -f y.tab.c y.tab.h
|
|
||||||
if [ $# -ne 1 ]; then
|
|
||||||
eval LASTARG="\${$#}"
|
|
||||||
case "$LASTARG" in
|
|
||||||
*.y)
|
|
||||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
|
||||||
if [ -f "$SRCFILE" ]; then
|
|
||||||
cp "$SRCFILE" y.tab.c
|
|
||||||
fi
|
|
||||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
|
||||||
if [ -f "$SRCFILE" ]; then
|
|
||||||
cp "$SRCFILE" y.tab.h
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
if [ ! -f y.tab.h ]; then
|
|
||||||
echo >y.tab.h
|
|
||||||
fi
|
|
||||||
if [ ! -f y.tab.c ]; then
|
|
||||||
echo 'main() { return 0; }' >y.tab.c
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
lex|flex)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a \`.l' file. You may need the \`Flex' package
|
|
||||||
in order for those modifications to take effect. You can get
|
|
||||||
\`Flex' from any GNU archive site."
|
|
||||||
rm -f lex.yy.c
|
|
||||||
if [ $# -ne 1 ]; then
|
|
||||||
eval LASTARG="\${$#}"
|
|
||||||
case "$LASTARG" in
|
|
||||||
*.l)
|
|
||||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
|
||||||
if [ -f "$SRCFILE" ]; then
|
|
||||||
cp "$SRCFILE" lex.yy.c
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
if [ ! -f lex.yy.c ]; then
|
|
||||||
echo 'main() { return 0; }' >lex.yy.c
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
help2man)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a dependency of a manual page. You may need the
|
|
||||||
\`Help2man' package in order for those modifications to take
|
|
||||||
effect. You can get \`Help2man' from any GNU archive site."
|
|
||||||
|
|
||||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
|
||||||
if test -z "$file"; then
|
|
||||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
|
||||||
fi
|
|
||||||
if [ -f "$file" ]; then
|
|
||||||
touch $file
|
|
||||||
else
|
|
||||||
test -z "$file" || exec >$file
|
|
||||||
echo ".ab help2man is required to generate this page"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
makeinfo)
|
|
||||||
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
|
|
||||||
# We have makeinfo, but it failed.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is missing on your system. You should only need it if
|
|
||||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
|
||||||
indirectly affecting the aspect of the manual. The spurious
|
|
||||||
call might also be the consequence of using a buggy \`make' (AIX,
|
|
||||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
|
||||||
the \`GNU make' package. Grab either from any GNU archive site."
|
|
||||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
|
||||||
if test -z "$file"; then
|
|
||||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
|
||||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
|
||||||
fi
|
|
||||||
touch $file
|
|
||||||
;;
|
|
||||||
|
|
||||||
tar)
|
|
||||||
shift
|
|
||||||
if test -n "$run"; then
|
|
||||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# We have already tried tar in the generic part.
|
|
||||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
|
||||||
# messages.
|
|
||||||
if (gnutar --version > /dev/null 2>&1); then
|
|
||||||
gnutar ${1+"$@"} && exit 0
|
|
||||||
fi
|
|
||||||
if (gtar --version > /dev/null 2>&1); then
|
|
||||||
gtar ${1+"$@"} && exit 0
|
|
||||||
fi
|
|
||||||
firstarg="$1"
|
|
||||||
if shift; then
|
|
||||||
case "$firstarg" in
|
|
||||||
*o*)
|
|
||||||
firstarg=`echo "$firstarg" | sed s/o//`
|
|
||||||
tar "$firstarg" ${1+"$@"} && exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
case "$firstarg" in
|
|
||||||
*h*)
|
|
||||||
firstarg=`echo "$firstarg" | sed s/h//`
|
|
||||||
tar "$firstarg" ${1+"$@"} && exit 0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
|
||||||
You may want to install GNU tar or Free paxutils, or check the
|
|
||||||
command line arguments."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo 1>&2 "\
|
|
||||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
|
||||||
system. You might have modified some files without having the
|
|
||||||
proper tools for further handling them. Check the \`README' file,
|
|
||||||
it often tells you about the needed prerequirements for installing
|
|
||||||
this package. You may also peek at any GNU archive site, in case
|
|
||||||
some other package would contain this missing \`$1' program."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
40
src/external/tclap-1.2.5/config/mkinstalldirs
vendored
40
src/external/tclap-1.2.5/config/mkinstalldirs
vendored
@ -1,40 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# mkinstalldirs --- make directory hierarchy
|
|
||||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
|
||||||
# Created: 1993-05-16
|
|
||||||
# Public domain
|
|
||||||
|
|
||||||
# $Id: mkinstalldirs,v 1.1 2003/04/03 18:13:41 mes5k Exp $
|
|
||||||
|
|
||||||
errstatus=0
|
|
||||||
|
|
||||||
for file
|
|
||||||
do
|
|
||||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
|
||||||
shift
|
|
||||||
|
|
||||||
pathcomp=
|
|
||||||
for d
|
|
||||||
do
|
|
||||||
pathcomp="$pathcomp$d"
|
|
||||||
case "$pathcomp" in
|
|
||||||
-* ) pathcomp=./$pathcomp ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test ! -d "$pathcomp"; then
|
|
||||||
echo "mkdir $pathcomp"
|
|
||||||
|
|
||||||
mkdir "$pathcomp" || lasterr=$?
|
|
||||||
|
|
||||||
if test ! -d "$pathcomp"; then
|
|
||||||
errstatus=$lasterr
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
pathcomp="$pathcomp/"
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
exit $errstatus
|
|
||||||
|
|
||||||
# mkinstalldirs ends here
|
|
153
src/external/tclap-1.2.5/config/test-driver
vendored
153
src/external/tclap-1.2.5/config/test-driver
vendored
@ -1,153 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# test-driver - basic testsuite driver script.
|
|
||||||
|
|
||||||
scriptversion=2018-03-07.03; # UTC
|
|
||||||
|
|
||||||
# Copyright (C) 2011-2021 Free Software Foundation, Inc.
|
|
||||||
#
|
|
||||||
# This program is free software; you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU General Public License as published by
|
|
||||||
# the Free Software Foundation; either version 2, or (at your option)
|
|
||||||
# any later version.
|
|
||||||
#
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
# GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License
|
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# As a special exception to the GNU General Public License, if you
|
|
||||||
# distribute this file as part of a program that contains a
|
|
||||||
# configuration script generated by Autoconf, you may include it under
|
|
||||||
# the same distribution terms that you use for the rest of that program.
|
|
||||||
|
|
||||||
# This file is maintained in Automake, please report
|
|
||||||
# bugs to <bug-automake@gnu.org> or send patches to
|
|
||||||
# <automake-patches@gnu.org>.
|
|
||||||
|
|
||||||
# Make unconditional expansion of undefined variables an error. This
|
|
||||||
# helps a lot in preventing typo-related bugs.
|
|
||||||
set -u
|
|
||||||
|
|
||||||
usage_error ()
|
|
||||||
{
|
|
||||||
echo "$0: $*" >&2
|
|
||||||
print_usage >&2
|
|
||||||
exit 2
|
|
||||||
}
|
|
||||||
|
|
||||||
print_usage ()
|
|
||||||
{
|
|
||||||
cat <<END
|
|
||||||
Usage:
|
|
||||||
test-driver --test-name NAME --log-file PATH --trs-file PATH
|
|
||||||
[--expect-failure {yes|no}] [--color-tests {yes|no}]
|
|
||||||
[--enable-hard-errors {yes|no}] [--]
|
|
||||||
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
|
|
||||||
|
|
||||||
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
|
|
||||||
See the GNU Automake documentation for information.
|
|
||||||
END
|
|
||||||
}
|
|
||||||
|
|
||||||
test_name= # Used for reporting.
|
|
||||||
log_file= # Where to save the output of the test script.
|
|
||||||
trs_file= # Where to save the metadata of the test run.
|
|
||||||
expect_failure=no
|
|
||||||
color_tests=no
|
|
||||||
enable_hard_errors=yes
|
|
||||||
while test $# -gt 0; do
|
|
||||||
case $1 in
|
|
||||||
--help) print_usage; exit $?;;
|
|
||||||
--version) echo "test-driver $scriptversion"; exit $?;;
|
|
||||||
--test-name) test_name=$2; shift;;
|
|
||||||
--log-file) log_file=$2; shift;;
|
|
||||||
--trs-file) trs_file=$2; shift;;
|
|
||||||
--color-tests) color_tests=$2; shift;;
|
|
||||||
--expect-failure) expect_failure=$2; shift;;
|
|
||||||
--enable-hard-errors) enable_hard_errors=$2; shift;;
|
|
||||||
--) shift; break;;
|
|
||||||
-*) usage_error "invalid option: '$1'";;
|
|
||||||
*) break;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
missing_opts=
|
|
||||||
test x"$test_name" = x && missing_opts="$missing_opts --test-name"
|
|
||||||
test x"$log_file" = x && missing_opts="$missing_opts --log-file"
|
|
||||||
test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
|
|
||||||
if test x"$missing_opts" != x; then
|
|
||||||
usage_error "the following mandatory options are missing:$missing_opts"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $# -eq 0; then
|
|
||||||
usage_error "missing argument"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $color_tests = yes; then
|
|
||||||
# Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
|
|
||||||
red='[0;31m' # Red.
|
|
||||||
grn='[0;32m' # Green.
|
|
||||||
lgn='[1;32m' # Light green.
|
|
||||||
blu='[1;34m' # Blue.
|
|
||||||
mgn='[0;35m' # Magenta.
|
|
||||||
std='[m' # No color.
|
|
||||||
else
|
|
||||||
red= grn= lgn= blu= mgn= std=
|
|
||||||
fi
|
|
||||||
|
|
||||||
do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
|
|
||||||
trap "st=129; $do_exit" 1
|
|
||||||
trap "st=130; $do_exit" 2
|
|
||||||
trap "st=141; $do_exit" 13
|
|
||||||
trap "st=143; $do_exit" 15
|
|
||||||
|
|
||||||
# Test script is run here. We create the file first, then append to it,
|
|
||||||
# to ameliorate tests themselves also writing to the log file. Our tests
|
|
||||||
# don't, but others can (automake bug#35762).
|
|
||||||
: >"$log_file"
|
|
||||||
"$@" >>"$log_file" 2>&1
|
|
||||||
estatus=$?
|
|
||||||
|
|
||||||
if test $enable_hard_errors = no && test $estatus -eq 99; then
|
|
||||||
tweaked_estatus=1
|
|
||||||
else
|
|
||||||
tweaked_estatus=$estatus
|
|
||||||
fi
|
|
||||||
|
|
||||||
case $tweaked_estatus:$expect_failure in
|
|
||||||
0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
|
|
||||||
0:*) col=$grn res=PASS recheck=no gcopy=no;;
|
|
||||||
77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
|
|
||||||
99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
|
|
||||||
*:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
|
|
||||||
*:*) col=$red res=FAIL recheck=yes gcopy=yes;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Report the test outcome and exit status in the logs, so that one can
|
|
||||||
# know whether the test passed or failed simply by looking at the '.log'
|
|
||||||
# file, without the need of also peaking into the corresponding '.trs'
|
|
||||||
# file (automake bug#11814).
|
|
||||||
echo "$res $test_name (exit status: $estatus)" >>"$log_file"
|
|
||||||
|
|
||||||
# Report outcome to console.
|
|
||||||
echo "${col}${res}${std}: $test_name"
|
|
||||||
|
|
||||||
# Register the test result, and other relevant metadata.
|
|
||||||
echo ":test-result: $res" > $trs_file
|
|
||||||
echo ":global-test-result: $res" >> $trs_file
|
|
||||||
echo ":recheck: $recheck" >> $trs_file
|
|
||||||
echo ":copy-in-global-log: $gcopy" >> $trs_file
|
|
||||||
|
|
||||||
# Local Variables:
|
|
||||||
# mode: shell-script
|
|
||||||
# sh-indentation: 2
|
|
||||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC0"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
5687
src/external/tclap-1.2.5/configure
vendored
5687
src/external/tclap-1.2.5/configure
vendored
File diff suppressed because it is too large
Load Diff
33
src/external/tclap-1.2.5/configure.ac
vendored
33
src/external/tclap-1.2.5/configure.ac
vendored
@ -1,33 +0,0 @@
|
|||||||
AC_INIT([tclap],[1.2.5])
|
|
||||||
AC_CONFIG_AUX_DIR(config)
|
|
||||||
AC_CONFIG_SRCDIR([examples/test1.cpp])
|
|
||||||
AM_CONFIG_HEADER(config/config.h)
|
|
||||||
AM_INIT_AUTOMAKE
|
|
||||||
AC_PROG_CXX
|
|
||||||
AC_CXX_HAVE_SSTREAM
|
|
||||||
AC_CXX_HAVE_STRSTREAM
|
|
||||||
AC_CXX_HAVE_LONG_LONG
|
|
||||||
AC_CHECK_PROG(DOT,dot,YES,NO)
|
|
||||||
AC_PROG_RANLIB
|
|
||||||
AC_PROG_INSTALL
|
|
||||||
BB_ENABLE_DOXYGEN
|
|
||||||
|
|
||||||
HAVE_WARN_EFFECTIVE_CXX
|
|
||||||
CXXFLAGS="$CXXFLAGS $WARN_EFFECTIVE_CXX"
|
|
||||||
|
|
||||||
AM_CONDITIONAL([HAVE_GNU_COMPILERS], [test x$ac_cv_cxx_compiler_gnu = xyes])
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([ Makefile \
|
|
||||||
tclap.pc \
|
|
||||||
examples/Makefile \
|
|
||||||
include/Makefile \
|
|
||||||
include/tclap/Makefile \
|
|
||||||
config/Makefile \
|
|
||||||
docs/Makefile \
|
|
||||||
docs/Doxyfile \
|
|
||||||
msc/Makefile \
|
|
||||||
msc/examples/Makefile \
|
|
||||||
tests/Makefile])
|
|
||||||
AC_CONFIG_COMMANDS([default],[\
|
|
||||||
chmod a+x $ac_top_srcdir/tests/*.sh],[])
|
|
||||||
AC_OUTPUT
|
|
1078
src/external/tclap-1.2.5/docs/Doxyfile.in
vendored
1078
src/external/tclap-1.2.5/docs/Doxyfile.in
vendored
File diff suppressed because it is too large
Load Diff
35
src/external/tclap-1.2.5/docs/Makefile.am
vendored
35
src/external/tclap-1.2.5/docs/Makefile.am
vendored
@ -1,35 +0,0 @@
|
|||||||
.NOTPARALLEL:
|
|
||||||
|
|
||||||
if DOC
|
|
||||||
|
|
||||||
all:
|
|
||||||
@DOXYGEN@ Doxyfile
|
|
||||||
|
|
||||||
manual: manual.xml
|
|
||||||
xsltproc -o $(abs_builddir)/manual.html --stringparam html.stylesheet style.css /usr/share/xml/docbook/stylesheet/docbook-xsl/html/docbook.xsl $(abs_srcdir)/manual.xml
|
|
||||||
else
|
|
||||||
|
|
||||||
all:
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
EXTRA_DIST = manual.xml
|
|
||||||
dist_doc_DATA = index.html manual.html style.css
|
|
||||||
docdir = ${datadir}/doc/${PACKAGE}
|
|
||||||
|
|
||||||
install-data-local :
|
|
||||||
$(mkdir_p) $(DESTDIR)$(docdir)
|
|
||||||
cp -R html $(DESTDIR)$(docdir)
|
|
||||||
|
|
||||||
uninstall-local :
|
|
||||||
chmod -R o+w $(DESTDIR)$(docdir)/html
|
|
||||||
rm -rf $(DESTDIR)$(docdir)/html
|
|
||||||
|
|
||||||
dist-hook :
|
|
||||||
$(mkdir_p) $(distdir)
|
|
||||||
cp -R $(abs_builddir)/html $(distdir)
|
|
||||||
|
|
||||||
clean-local:
|
|
||||||
$(RM) -rf $(abs_builddir)/html/*
|
|
||||||
$(RM) -rf $(abs_builddir)/doxygen_sqlite3.db
|
|
||||||
|
|
498
src/external/tclap-1.2.5/docs/Makefile.in
vendored
498
src/external/tclap-1.2.5/docs/Makefile.in
vendored
@ -1,498 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.16.4 from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
|
|
||||||
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
|
|
||||||
VPATH = @srcdir@
|
|
||||||
am__is_gnu_make = { \
|
|
||||||
if test -z '$(MAKELEVEL)'; then \
|
|
||||||
false; \
|
|
||||||
elif test -n '$(MAKE_HOST)'; then \
|
|
||||||
true; \
|
|
||||||
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
|
|
||||||
true; \
|
|
||||||
else \
|
|
||||||
false; \
|
|
||||||
fi; \
|
|
||||||
}
|
|
||||||
am__make_running_with_option = \
|
|
||||||
case $${target_option-} in \
|
|
||||||
?) ;; \
|
|
||||||
*) echo "am__make_running_with_option: internal error: invalid" \
|
|
||||||
"target option '$${target_option-}' specified" >&2; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
has_opt=no; \
|
|
||||||
sane_makeflags=$$MAKEFLAGS; \
|
|
||||||
if $(am__is_gnu_make); then \
|
|
||||||
sane_makeflags=$$MFLAGS; \
|
|
||||||
else \
|
|
||||||
case $$MAKEFLAGS in \
|
|
||||||
*\\[\ \ ]*) \
|
|
||||||
bs=\\; \
|
|
||||||
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
|
|
||||||
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
|
|
||||||
esac; \
|
|
||||||
fi; \
|
|
||||||
skip_next=no; \
|
|
||||||
strip_trailopt () \
|
|
||||||
{ \
|
|
||||||
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
|
|
||||||
}; \
|
|
||||||
for flg in $$sane_makeflags; do \
|
|
||||||
test $$skip_next = yes && { skip_next=no; continue; }; \
|
|
||||||
case $$flg in \
|
|
||||||
*=*|--*) continue;; \
|
|
||||||
-*I) strip_trailopt 'I'; skip_next=yes;; \
|
|
||||||
-*I?*) strip_trailopt 'I';; \
|
|
||||||
-*O) strip_trailopt 'O'; skip_next=yes;; \
|
|
||||||
-*O?*) strip_trailopt 'O';; \
|
|
||||||
-*l) strip_trailopt 'l'; skip_next=yes;; \
|
|
||||||
-*l?*) strip_trailopt 'l';; \
|
|
||||||
-[dEDm]) skip_next=yes;; \
|
|
||||||
-[JT]) skip_next=yes;; \
|
|
||||||
esac; \
|
|
||||||
case $$flg in \
|
|
||||||
*$$target_option*) has_opt=yes; break;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
test $$has_opt = yes
|
|
||||||
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
|
|
||||||
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
subdir = docs
|
|
||||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/config/ac_cxx_have_long_long.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_have_sstream.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_have_strstream.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_namespaces.m4 \
|
|
||||||
$(top_srcdir)/config/ac_cxx_warn_effective_cxx.m4 \
|
|
||||||
$(top_srcdir)/config/bb_enable_doxygen.m4 \
|
|
||||||
$(top_srcdir)/configure.ac
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
|
||||||
$(ACLOCAL_M4)
|
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \
|
|
||||||
$(am__DIST_COMMON)
|
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
|
|
||||||
CONFIG_HEADER = $(top_builddir)/config/config.h
|
|
||||||
CONFIG_CLEAN_FILES = Doxyfile
|
|
||||||
CONFIG_CLEAN_VPATH_FILES =
|
|
||||||
AM_V_P = $(am__v_P_@AM_V@)
|
|
||||||
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
|
|
||||||
am__v_P_0 = false
|
|
||||||
am__v_P_1 = :
|
|
||||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
|
||||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
|
||||||
am__v_GEN_0 = @echo " GEN " $@;
|
|
||||||
am__v_GEN_1 =
|
|
||||||
AM_V_at = $(am__v_at_@AM_V@)
|
|
||||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|
||||||
am__v_at_0 = @
|
|
||||||
am__v_at_1 =
|
|
||||||
SOURCES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
am__can_run_installinfo = \
|
|
||||||
case $$AM_UPDATE_INFO_DIR in \
|
|
||||||
n|no|NO) false;; \
|
|
||||||
*) (install-info --version) >/dev/null 2>&1;; \
|
|
||||||
esac
|
|
||||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
|
||||||
am__vpath_adj = case $$p in \
|
|
||||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
|
||||||
*) f=$$p;; \
|
|
||||||
esac;
|
|
||||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
|
||||||
am__install_max = 40
|
|
||||||
am__nobase_strip_setup = \
|
|
||||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
|
||||||
am__nobase_strip = \
|
|
||||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
|
||||||
am__nobase_list = $(am__nobase_strip_setup); \
|
|
||||||
for p in $$list; do echo "$$p $$p"; done | \
|
|
||||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
|
||||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
|
||||||
if (++n[$$2] == $(am__install_max)) \
|
|
||||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
|
||||||
END { for (dir in files) print dir, files[dir] }'
|
|
||||||
am__base_list = \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
|
||||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
|
||||||
am__uninstall_files_from_dir = { \
|
|
||||||
test -z "$$files" \
|
|
||||||
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|
|
||||||
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
|
|
||||||
$(am__cd) "$$dir" && rm -f $$files; }; \
|
|
||||||
}
|
|
||||||
am__installdirs = "$(DESTDIR)$(docdir)"
|
|
||||||
DATA = $(dist_doc_DATA)
|
|
||||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
|
||||||
am__DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.in \
|
|
||||||
$(top_srcdir)/config/mkinstalldirs README
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
ACLOCAL = @ACLOCAL@
|
|
||||||
AMTAR = @AMTAR@
|
|
||||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
|
||||||
AUTOCONF = @AUTOCONF@
|
|
||||||
AUTOHEADER = @AUTOHEADER@
|
|
||||||
AUTOMAKE = @AUTOMAKE@
|
|
||||||
AWK = @AWK@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
CSCOPE = @CSCOPE@
|
|
||||||
CTAGS = @CTAGS@
|
|
||||||
CXX = @CXX@
|
|
||||||
CXXDEPMODE = @CXXDEPMODE@
|
|
||||||
CXXFLAGS = @CXXFLAGS@
|
|
||||||
CYGPATH_W = @CYGPATH_W@
|
|
||||||
DEFS = @DEFS@
|
|
||||||
DEPDIR = @DEPDIR@
|
|
||||||
DOT = @DOT@
|
|
||||||
DOXYGEN = @DOXYGEN@
|
|
||||||
ECHO_C = @ECHO_C@
|
|
||||||
ECHO_N = @ECHO_N@
|
|
||||||
ECHO_T = @ECHO_T@
|
|
||||||
ETAGS = @ETAGS@
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LIBOBJS = @LIBOBJS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
|
||||||
MAKEINFO = @MAKEINFO@
|
|
||||||
MKDIR_P = @MKDIR_P@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
PACKAGE = @PACKAGE@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
RANLIB = @RANLIB@
|
|
||||||
SET_MAKE = @SET_MAKE@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
STRIP = @STRIP@
|
|
||||||
VERSION = @VERSION@
|
|
||||||
WARN_EFFECTIVE_CXX = @WARN_EFFECTIVE_CXX@
|
|
||||||
WARN_NO_EFFECTIVE_CXX = @WARN_NO_EFFECTIVE_CXX@
|
|
||||||
abs_builddir = @abs_builddir@
|
|
||||||
abs_srcdir = @abs_srcdir@
|
|
||||||
abs_top_builddir = @abs_top_builddir@
|
|
||||||
abs_top_srcdir = @abs_top_srcdir@
|
|
||||||
ac_ct_CXX = @ac_ct_CXX@
|
|
||||||
am__include = @am__include@
|
|
||||||
am__leading_dot = @am__leading_dot@
|
|
||||||
am__quote = @am__quote@
|
|
||||||
am__tar = @am__tar@
|
|
||||||
am__untar = @am__untar@
|
|
||||||
bindir = @bindir@
|
|
||||||
build_alias = @build_alias@
|
|
||||||
builddir = @builddir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
docdir = ${datadir}/doc/${PACKAGE}
|
|
||||||
dvidir = @dvidir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
host_alias = @host_alias@
|
|
||||||
htmldir = @htmldir@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
install_sh = @install_sh@
|
|
||||||
libdir = @libdir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
localedir = @localedir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
mandir = @mandir@
|
|
||||||
mkdir_p = @mkdir_p@
|
|
||||||
oldincludedir = @oldincludedir@
|
|
||||||
pdfdir = @pdfdir@
|
|
||||||
prefix = @prefix@
|
|
||||||
program_transform_name = @program_transform_name@
|
|
||||||
psdir = @psdir@
|
|
||||||
runstatedir = @runstatedir@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
target_alias = @target_alias@
|
|
||||||
top_build_prefix = @top_build_prefix@
|
|
||||||
top_builddir = @top_builddir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
EXTRA_DIST = manual.xml
|
|
||||||
dist_doc_DATA = index.html manual.html style.css
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
|
||||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \
|
|
||||||
$(am__cd) $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu docs/Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: $(am__configure_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
$(am__aclocal_m4_deps):
|
|
||||||
Doxyfile: $(top_builddir)/config.status $(srcdir)/Doxyfile.in
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
|
||||||
install-dist_docDATA: $(dist_doc_DATA)
|
|
||||||
@$(NORMAL_INSTALL)
|
|
||||||
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
|
|
||||||
if test -n "$$list"; then \
|
|
||||||
echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
|
|
||||||
fi; \
|
|
||||||
for p in $$list; do \
|
|
||||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
|
||||||
echo "$$d$$p"; \
|
|
||||||
done | $(am__base_list) | \
|
|
||||||
while read files; do \
|
|
||||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
|
|
||||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
|
|
||||||
done
|
|
||||||
|
|
||||||
uninstall-dist_docDATA:
|
|
||||||
@$(NORMAL_UNINSTALL)
|
|
||||||
@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
|
|
||||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
|
||||||
dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
|
|
||||||
tags TAGS:
|
|
||||||
|
|
||||||
ctags CTAGS:
|
|
||||||
|
|
||||||
cscope cscopelist:
|
|
||||||
|
|
||||||
distdir: $(BUILT_SOURCES)
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
|
||||||
|
|
||||||
distdir-am: $(DISTFILES)
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
|
||||||
list='$(DISTFILES)'; \
|
|
||||||
dist_files=`for file in $$list; do echo $$file; done | \
|
|
||||||
sed -e "s|^$$srcdirstrip/||;t" \
|
|
||||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
|
||||||
case $$dist_files in \
|
|
||||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
|
||||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
|
||||||
sort -u` ;; \
|
|
||||||
esac; \
|
|
||||||
for file in $$dist_files; do \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test -d "$(distdir)/$$file"; then \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|
||||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
|
||||||
fi; \
|
|
||||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
|
||||||
else \
|
|
||||||
test -f "$(distdir)/$$file" \
|
|
||||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) \
|
|
||||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
|
||||||
dist-hook
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile $(DATA)
|
|
||||||
installdirs:
|
|
||||||
for dir in "$(DESTDIR)$(docdir)"; do \
|
|
||||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
|
||||||
done
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
if test -z '$(STRIP)'; then \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
install; \
|
|
||||||
else \
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
|
||||||
fi
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
|
||||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic clean-local mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
html-am:
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am: install-data-local install-dist_docDATA
|
|
||||||
|
|
||||||
install-dvi: install-dvi-am
|
|
||||||
|
|
||||||
install-dvi-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-html: install-html-am
|
|
||||||
|
|
||||||
install-html-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-info-am:
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
install-pdf: install-pdf-am
|
|
||||||
|
|
||||||
install-pdf-am:
|
|
||||||
|
|
||||||
install-ps: install-ps-am
|
|
||||||
|
|
||||||
install-ps-am:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic
|
|
||||||
|
|
||||||
pdf: pdf-am
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-am
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am: uninstall-dist_docDATA uninstall-local
|
|
||||||
|
|
||||||
.MAKE: install-am install-strip
|
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic clean-local \
|
|
||||||
cscopelist-am ctags-am dist-hook distclean distclean-generic \
|
|
||||||
distdir dvi dvi-am html html-am info info-am install \
|
|
||||||
install-am install-data install-data-am install-data-local \
|
|
||||||
install-dist_docDATA install-dvi install-dvi-am install-exec \
|
|
||||||
install-exec-am install-html install-html-am install-info \
|
|
||||||
install-info-am install-man install-pdf install-pdf-am \
|
|
||||||
install-ps install-ps-am install-strip installcheck \
|
|
||||||
installcheck-am installdirs maintainer-clean \
|
|
||||||
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
|
|
||||||
pdf-am ps ps-am tags-am uninstall uninstall-am \
|
|
||||||
uninstall-dist_docDATA uninstall-local
|
|
||||||
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
|
|
||||||
.NOTPARALLEL:
|
|
||||||
|
|
||||||
@DOC_TRUE@all:
|
|
||||||
@DOC_TRUE@ @DOXYGEN@ Doxyfile
|
|
||||||
|
|
||||||
@DOC_TRUE@manual: manual.xml
|
|
||||||
@DOC_TRUE@ xsltproc -o $(abs_builddir)/manual.html --stringparam html.stylesheet style.css /usr/share/xml/docbook/stylesheet/docbook-xsl/html/docbook.xsl $(abs_srcdir)/manual.xml
|
|
||||||
|
|
||||||
@DOC_FALSE@all:
|
|
||||||
|
|
||||||
install-data-local :
|
|
||||||
$(mkdir_p) $(DESTDIR)$(docdir)
|
|
||||||
cp -R html $(DESTDIR)$(docdir)
|
|
||||||
|
|
||||||
uninstall-local :
|
|
||||||
chmod -R o+w $(DESTDIR)$(docdir)/html
|
|
||||||
rm -rf $(DESTDIR)$(docdir)/html
|
|
||||||
|
|
||||||
dist-hook :
|
|
||||||
$(mkdir_p) $(distdir)
|
|
||||||
cp -R $(abs_builddir)/html $(distdir)
|
|
||||||
|
|
||||||
clean-local:
|
|
||||||
$(RM) -rf $(abs_builddir)/html/*
|
|
||||||
$(RM) -rf $(abs_builddir)/doxygen_sqlite3.db
|
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
||||||
.NOEXPORT:
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user