Compare commits
126 Commits
Aufgabe_1
...
35f051b5da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35f051b5da | ||
|
|
221a08e7dc | ||
|
|
84dcb63ea7 | ||
|
|
958c383f85 | ||
|
|
f3829559d4 | ||
|
|
9155216fd2 | ||
|
|
b6320ecba7 | ||
|
|
3bd8b9ac20 | ||
|
|
147415beef | ||
|
|
5fb42ff984 | ||
|
|
d7bb53687d | ||
|
|
ee27de7481 | ||
|
|
eaab6ab023 | ||
|
|
38f06b1575 | ||
|
|
6ebc065a7a | ||
|
|
8c45b02769 | ||
|
|
4cc117fdd4 | ||
|
|
49e4911238 | ||
|
|
21c1f8fee6 | ||
|
|
30311a393d | ||
|
|
daacbc705d | ||
|
|
b77ea3d3d8 | ||
|
|
29dc364f94 | ||
|
|
fd15e54cdd | ||
|
|
460def3fc6 | ||
|
|
4cf1a82974 | ||
|
|
bc56a6a1c2 | ||
|
|
84320f00c7 | ||
|
|
8d667ec836 | ||
|
|
520cfa57d5 | ||
|
|
2df1debe1a | ||
|
|
9475dd6666 | ||
|
|
03b88a8a76 | ||
|
|
91b36a53d5 | ||
|
|
169217fd2c | ||
| 084b715729 | |||
| 7d2e5ad1cd | |||
|
|
08109a4f16 | ||
|
|
ade4f8e18d | ||
|
|
9f7cd4aefc | ||
|
|
82704187f9 | ||
|
|
4f0fc8a364 | ||
|
|
797bfa45eb | ||
|
|
1c0d85b5c9 | ||
|
|
dc5a98c401 | ||
|
|
c174108e09 | ||
|
|
e8b4062331 | ||
|
|
f0d74a7e17 | ||
|
|
1ea539ddea | ||
|
|
69b4a1afb4 | ||
|
|
3a046d6f89 | ||
| eba9656631 | |||
|
|
f60e82b46b | ||
| 1f02f49cdf | |||
|
|
6319ddcad9 | ||
| 9b4a9faa8d | |||
| 4d24ab038c | |||
| 82d3201374 | |||
| e5f2858a5c | |||
| 906ea30be2 | |||
|
|
70dbd0253b | ||
| 5039f95153 | |||
| dbafdbeea5 | |||
|
|
ac57431ac4 | ||
|
|
3935d2778b | ||
|
|
37843d9356 | ||
|
|
6cc2ff87ca | ||
|
|
f29f500d0c | ||
|
|
23e787eb5e | ||
|
|
94fb404c71 | ||
| 847f68bb29 | |||
| da06afd43b | |||
| 9421d34756 | |||
|
|
60bdfd7843 | ||
| bdb0ce63b8 | |||
| dcb665f5a6 | |||
|
|
82dc5f28cc | ||
| 8be99c5244 | |||
| 742f050b24 | |||
| 14025d3b08 | |||
| 3f12378110 | |||
| 2cb94eaf76 | |||
| 9d64b87a09 | |||
| b87ebbe841 | |||
| 829735eb8c | |||
| 44f70a1777 | |||
| 5a7338f91c | |||
| a8999f4ec2 | |||
| c0a5e694c0 | |||
|
|
61a138fdee | ||
| 55af679c39 | |||
| 27400289f5 | |||
| c0d25212af | |||
| 10a6883750 | |||
|
|
33a2994c29 | ||
|
|
7390df9ee0 | ||
|
|
83dae77e31 | ||
|
|
fb8497fbee | ||
| dc16504cd7 | |||
| 2a427a2563 | |||
| 0e52973475 | |||
|
|
8b3770df80 | ||
| dc33e46e24 | |||
| c900a0444f | |||
| c16fe6349b | |||
| 1363db7c11 | |||
| dfedf2e717 | |||
| 4d547cca6a | |||
| 6740f41edc | |||
| 9890324ea5 | |||
| efe7663637 | |||
| 4e629a6ca7 | |||
| d947afdf03 | |||
| d05c415295 | |||
| d23727f6da | |||
| 62ede37645 | |||
| 9f7b69e5f7 | |||
|
|
7d7b67f7f2 | ||
|
|
655da552de | ||
| 4f23944408 | |||
| 19de6c2dbc | |||
| 49b064d74d | |||
|
|
119b5be760 | ||
|
|
23690576ea | ||
|
|
8a7d900d9a | ||
|
|
1b742e0007 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,5 @@
|
||||
.idea
|
||||
cmake-build-debug
|
||||
njvm
|
||||
njvm.dSYM
|
||||
njvm.exe
|
||||
|
||||
@@ -2,11 +2,22 @@ cmake_minimum_required(VERSION 3.0)
|
||||
project(ninja LANGUAGES C)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(PROJECT_VERSION 0)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/config.h.in
|
||||
${CMAKE_BINARY_DIR}/config.h
|
||||
)
|
||||
include_directories(${CMAKE_BINARY_DIR})
|
||||
add_executable(ninja
|
||||
njvm.c config.h.in)
|
||||
|
||||
add_compile_options(-g -Wall -pedantic)
|
||||
|
||||
add_executable(njvm njvm.c)
|
||||
|
||||
# Include directories for njvm executable
|
||||
target_include_directories(njvm PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/bigint/build/include)
|
||||
|
||||
# Add the library
|
||||
add_library(bigint STATIC ${CMAKE_SOURCE_DIR}/bigint/src/bigint.c
|
||||
support.c
|
||||
GC.c)
|
||||
|
||||
# Include directories for the bigint library
|
||||
target_include_directories(bigint PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/bigint/build/include)
|
||||
|
||||
# Link the executable with the library
|
||||
target_link_libraries(njvm PRIVATE bigint)
|
||||
|
||||
|
||||
105
GC.c
Normal file
105
GC.c
Normal file
@@ -0,0 +1,105 @@
|
||||
#ifndef GC
|
||||
#define GC
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include "objref.c"
|
||||
#include "instruktion.c"
|
||||
|
||||
bool halbspeicher1IsActiv = true;
|
||||
unsigned char* halbspeicher1;
|
||||
unsigned char* halbspeicher2;
|
||||
unsigned char* freizeiger;
|
||||
unsigned int groesse;
|
||||
|
||||
void initHeap(unsigned int size){
|
||||
groesse = size*1024/2;
|
||||
if((halbspeicher1 = malloc(groesse)) == NULL) perror("malloc");
|
||||
if((halbspeicher2 = malloc(groesse)) == NULL) perror("malloc");
|
||||
freizeiger = halbspeicher1;
|
||||
}
|
||||
ObjRef copyObjToFreeMem(ObjRef obj){
|
||||
ObjRef copy = (ObjRef) halbspeicher2[freizeiger];
|
||||
unsigned int size = (IS_PRIMITIVE(obj))? obj->size : GET_ELEMENT_COUNT(obj)* sizeof(void *);
|
||||
memcpy((void *) halbspeicher2[freizeiger], obj, size);
|
||||
freizeiger += size;
|
||||
return copy;
|
||||
}
|
||||
void setBrokenHeart(ObjRef obj, bool val){
|
||||
//TODO
|
||||
}
|
||||
bool getBrokenHeart(ObjRef obj){
|
||||
//TODO
|
||||
return true;
|
||||
}
|
||||
void setForwardPointer(ObjRef obj, void* ref){
|
||||
//TODO
|
||||
}
|
||||
void *getForwardPointer(ObjRef obj){
|
||||
//TODO
|
||||
return malloc(0);
|
||||
}
|
||||
|
||||
ObjRef reallocate(ObjRef orig){
|
||||
ObjRef copy;
|
||||
if(orig == NULL){
|
||||
copy == NULL;
|
||||
}else{
|
||||
if(getBrokenHeart(orig)){
|
||||
setForwardPointer(copy,orig);
|
||||
}else{
|
||||
copy = copyObjToFreeMem(orig);
|
||||
setBrokenHeart(orig,true);
|
||||
setForwardPointer(orig,copy);
|
||||
}
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
unsigned int getSize(ObjRef obj){
|
||||
return (IS_PRIMITIVE(obj))? obj->size : GET_ELEMENT_COUNT(obj)* sizeof(void *);
|
||||
}
|
||||
void scan(void){
|
||||
void *scan = halbspeicher1;
|
||||
while (scan < freizeiger){
|
||||
if(!IS_PRIMITIVE((ObjRef)scan)){
|
||||
for (unsigned int i = 0; i < GET_ELEMENT_COUNT((ObjRef)scan); i += getSize(GET_REFS_PTR((ObjRef)scan)[i])) {
|
||||
GET_REFS_PTR((ObjRef)scan)[i] = reallocate(GET_REFS_PTR((ObjRef)scan)[i]);
|
||||
}
|
||||
}
|
||||
scan += getSize((ObjRef)scan);
|
||||
}
|
||||
}
|
||||
void *alloc(unsigned int size){
|
||||
if((&freizeiger - &halbspeicher1)/8 + size > groesse) {
|
||||
printf("Heap Overflow\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
// Set broken heart to false
|
||||
setBrokenHeart((ObjRef)freizeiger,false);
|
||||
freizeiger += sizeof(bool) + sizeof(void *);
|
||||
void *ptr = &freizeiger;
|
||||
freizeiger += size;
|
||||
return ptr;
|
||||
}
|
||||
void swap(void){
|
||||
unsigned char *tmp = halbspeicher1;
|
||||
halbspeicher1 = halbspeicher2;
|
||||
halbspeicher2 = tmp;
|
||||
freizeiger = halbspeicher1;
|
||||
halbspeicher1IsActiv = !halbspeicher1IsActiv;
|
||||
}
|
||||
void triggerGC(void){
|
||||
printf("GC triggered\n");
|
||||
//TODO
|
||||
}
|
||||
void copy(){
|
||||
ObjRef *test;
|
||||
unsigned int objResSize = 2;
|
||||
if((test = malloc(2*sizeof(test)))==NULL) perror("malloc");
|
||||
for (int i = 0; i < objResSize; ++i) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
12
Makefile
Normal file
12
Makefile
Normal file
@@ -0,0 +1,12 @@
|
||||
# Makefile for a simple C program
|
||||
build:
|
||||
cd ./bigint; make; cd ..
|
||||
gcc -g -Wall -Ibigint/build/include -o support.o -c support.c
|
||||
gcc -g -Wall -Ibigint/build/include -o njvm.o -c njvm.c
|
||||
gcc -g -Wall -Lbigint/build/lib -o njvm njvm.o support.o -lbigint
|
||||
|
||||
run: build
|
||||
./njvm prog.bin
|
||||
|
||||
debug: build
|
||||
./njvm --debug prog.bin
|
||||
43
Makefile3
Normal file
43
Makefile3
Normal file
@@ -0,0 +1,43 @@
|
||||
# Makefile for a simple C program
|
||||
|
||||
# Compiler
|
||||
CC = gcc
|
||||
|
||||
# program to Run
|
||||
F = prog.bin
|
||||
|
||||
# Compiler flags
|
||||
CFLAGS = -g -Wall -Ibigint/build/include
|
||||
|
||||
LDFLAGS = -g -Wall -Lbigint/build/lib
|
||||
|
||||
# Source file
|
||||
SRC = njvm.c
|
||||
|
||||
# Executable name
|
||||
TARGET = njvm
|
||||
|
||||
njvm.o:
|
||||
$(CC) $(CFLAGS) -o njvm.o -c njvm.c
|
||||
|
||||
support.o:
|
||||
$(CC) $(CFLAGS) -o support.o -c support.c
|
||||
|
||||
# Default target
|
||||
all: njvm.o support.o
|
||||
$(CC) $(LDFLAGS) -o $(TARGET) njvm.o support.o -lbigint
|
||||
# Clean up
|
||||
clean:
|
||||
rm -f $(OBJ) $(TARGET)
|
||||
|
||||
debug: all
|
||||
./$(TARGET) --debug $(F)
|
||||
|
||||
run: all
|
||||
./$(TARGET) $(F)
|
||||
|
||||
nja: ./nja/nja$(V)
|
||||
./nja/nja$(V) $(IN) $(OUT)
|
||||
|
||||
njc: ./njc/njc$(V)
|
||||
./njc/njc$(V) $(IN) $(OUT)
|
||||
28
SDA.c
Normal file
28
SDA.c
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Created by Nils on 03.12.2023
|
||||
//
|
||||
#ifndef SDA
|
||||
#define SDA
|
||||
#include <stdio.h>
|
||||
#include "stackslot.c"
|
||||
struct sda {
|
||||
int *size;
|
||||
ObjRef *sda;
|
||||
};
|
||||
|
||||
ObjRef getSDA(int i, struct sda s) {
|
||||
return s.sda[i];
|
||||
}
|
||||
|
||||
void setSDA(int point, ObjRef val, struct sda s) {
|
||||
if (val == NULL) perror("Value is null");
|
||||
s.sda[point] = val;
|
||||
}
|
||||
|
||||
void printSDA(struct sda s) {
|
||||
for (int i = 0; i < *s.size; i++) {
|
||||
printf("%i\n", *(int *)getSDA(i, s)->data);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because one or more lines are too long
@@ -1,134 +0,0 @@
|
||||
{
|
||||
"inputs" :
|
||||
[
|
||||
{
|
||||
"path" : "CMakeLists.txt"
|
||||
},
|
||||
{
|
||||
"isGenerated" : true,
|
||||
"path" : "cmake-build-debug/CMakeFiles/3.25.2/CMakeSystem.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeSystemSpecificInitialize.cmake"
|
||||
},
|
||||
{
|
||||
"isGenerated" : true,
|
||||
"path" : "cmake-build-debug/CMakeFiles/3.25.2/CMakeCCompiler.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeSystemSpecificInformation.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeGenericSystem.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeInitializeConfigs.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/Windows.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/WindowsPaths.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeFindCodeBlocks.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/ProcessorCount.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeCInformation.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeLanguageInformation.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Compiler/GNU-C.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Compiler/GNU.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Compiler/CMakeCommonCompilerMacros.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/Windows-GNU-C.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/Windows-GNU.cmake"
|
||||
},
|
||||
{
|
||||
"isGenerated" : true,
|
||||
"path" : "cmake-build-debug/CMakeFiles/3.25.2/CMakeRCCompiler.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeRCInformation.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/Windows-windres.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/Windows-GNU-C-ABI.cmake"
|
||||
},
|
||||
{
|
||||
"isCMake" : true,
|
||||
"isExternal" : true,
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeCommonLanguageInclude.cmake"
|
||||
},
|
||||
{
|
||||
"path" : "config.h.in"
|
||||
}
|
||||
],
|
||||
"kind" : "cmakeFiles",
|
||||
"paths" :
|
||||
{
|
||||
"build" : "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug",
|
||||
"source" : "C:/Users/Nilss/CLionProjects/ninja"
|
||||
},
|
||||
"version" :
|
||||
{
|
||||
"major" : 1,
|
||||
"minor" : 0
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
{
|
||||
"configurations" :
|
||||
[
|
||||
{
|
||||
"directories" :
|
||||
[
|
||||
{
|
||||
"build" : ".",
|
||||
"jsonFile" : "directory-.-Debug-d0094a50bb2071803777.json",
|
||||
"minimumCMakeVersion" :
|
||||
{
|
||||
"string" : "3.0"
|
||||
},
|
||||
"projectIndex" : 0,
|
||||
"source" : ".",
|
||||
"targetIndexes" :
|
||||
[
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"name" : "Debug",
|
||||
"projects" :
|
||||
[
|
||||
{
|
||||
"directoryIndexes" :
|
||||
[
|
||||
0
|
||||
],
|
||||
"name" : "ninja",
|
||||
"targetIndexes" :
|
||||
[
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"targets" :
|
||||
[
|
||||
{
|
||||
"directoryIndex" : 0,
|
||||
"id" : "ninja::@6890427a1f51a3e7e1df",
|
||||
"jsonFile" : "target-ninja-Debug-f292f08edd698e5009d2.json",
|
||||
"name" : "ninja",
|
||||
"projectIndex" : 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"kind" : "codemodel",
|
||||
"paths" :
|
||||
{
|
||||
"build" : "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug",
|
||||
"source" : "C:/Users/Nilss/CLionProjects/ninja"
|
||||
},
|
||||
"version" :
|
||||
{
|
||||
"major" : 2,
|
||||
"minor" : 4
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"backtraceGraph" :
|
||||
{
|
||||
"commands" : [],
|
||||
"files" : [],
|
||||
"nodes" : []
|
||||
},
|
||||
"installers" : [],
|
||||
"paths" :
|
||||
{
|
||||
"build" : ".",
|
||||
"source" : "."
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
{
|
||||
"cmake" :
|
||||
{
|
||||
"generator" :
|
||||
{
|
||||
"multiConfig" : false,
|
||||
"name" : "MinGW Makefiles"
|
||||
},
|
||||
"paths" :
|
||||
{
|
||||
"cmake" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/bin/cmake.exe",
|
||||
"cpack" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/bin/cpack.exe",
|
||||
"ctest" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/bin/ctest.exe",
|
||||
"root" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25"
|
||||
},
|
||||
"version" :
|
||||
{
|
||||
"isDirty" : false,
|
||||
"major" : 3,
|
||||
"minor" : 25,
|
||||
"patch" : 2,
|
||||
"string" : "3.25.2",
|
||||
"suffix" : ""
|
||||
}
|
||||
},
|
||||
"objects" :
|
||||
[
|
||||
{
|
||||
"jsonFile" : "codemodel-v2-23072077a90ad9331d20.json",
|
||||
"kind" : "codemodel",
|
||||
"version" :
|
||||
{
|
||||
"major" : 2,
|
||||
"minor" : 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"jsonFile" : "cache-v2-04d7c2d5c2c139b5c81c.json",
|
||||
"kind" : "cache",
|
||||
"version" :
|
||||
{
|
||||
"major" : 2,
|
||||
"minor" : 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"jsonFile" : "cmakeFiles-v1-b12e026c23bbd32d623a.json",
|
||||
"kind" : "cmakeFiles",
|
||||
"version" :
|
||||
{
|
||||
"major" : 1,
|
||||
"minor" : 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"jsonFile" : "toolchains-v1-0a3201452b7e265c1bfb.json",
|
||||
"kind" : "toolchains",
|
||||
"version" :
|
||||
{
|
||||
"major" : 1,
|
||||
"minor" : 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"reply" :
|
||||
{
|
||||
"cache-v2" :
|
||||
{
|
||||
"jsonFile" : "cache-v2-04d7c2d5c2c139b5c81c.json",
|
||||
"kind" : "cache",
|
||||
"version" :
|
||||
{
|
||||
"major" : 2,
|
||||
"minor" : 0
|
||||
}
|
||||
},
|
||||
"cmakeFiles-v1" :
|
||||
{
|
||||
"jsonFile" : "cmakeFiles-v1-b12e026c23bbd32d623a.json",
|
||||
"kind" : "cmakeFiles",
|
||||
"version" :
|
||||
{
|
||||
"major" : 1,
|
||||
"minor" : 0
|
||||
}
|
||||
},
|
||||
"codemodel-v2" :
|
||||
{
|
||||
"jsonFile" : "codemodel-v2-23072077a90ad9331d20.json",
|
||||
"kind" : "codemodel",
|
||||
"version" :
|
||||
{
|
||||
"major" : 2,
|
||||
"minor" : 4
|
||||
}
|
||||
},
|
||||
"toolchains-v1" :
|
||||
{
|
||||
"jsonFile" : "toolchains-v1-0a3201452b7e265c1bfb.json",
|
||||
"kind" : "toolchains",
|
||||
"version" :
|
||||
{
|
||||
"major" : 1,
|
||||
"minor" : 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
{
|
||||
"artifacts" :
|
||||
[
|
||||
{
|
||||
"path" : "ninja.exe"
|
||||
},
|
||||
{
|
||||
"path" : "ninja.pdb"
|
||||
}
|
||||
],
|
||||
"backtrace" : 1,
|
||||
"backtraceGraph" :
|
||||
{
|
||||
"commands" :
|
||||
[
|
||||
"add_executable",
|
||||
"include_directories"
|
||||
],
|
||||
"files" :
|
||||
[
|
||||
"CMakeLists.txt"
|
||||
],
|
||||
"nodes" :
|
||||
[
|
||||
{
|
||||
"file" : 0
|
||||
},
|
||||
{
|
||||
"command" : 0,
|
||||
"file" : 0,
|
||||
"line" : 11,
|
||||
"parent" : 0
|
||||
},
|
||||
{
|
||||
"command" : 1,
|
||||
"file" : 0,
|
||||
"line" : 10,
|
||||
"parent" : 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"compileGroups" :
|
||||
[
|
||||
{
|
||||
"compileCommandFragments" :
|
||||
[
|
||||
{
|
||||
"fragment" : "-g -fdiagnostics-color=always"
|
||||
},
|
||||
{
|
||||
"fragment" : "-std=gnu99"
|
||||
}
|
||||
],
|
||||
"includes" :
|
||||
[
|
||||
{
|
||||
"backtrace" : 2,
|
||||
"path" : "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug"
|
||||
}
|
||||
],
|
||||
"language" : "C",
|
||||
"languageStandard" :
|
||||
{
|
||||
"backtraces" :
|
||||
[
|
||||
1
|
||||
],
|
||||
"standard" : "99"
|
||||
},
|
||||
"sourceIndexes" :
|
||||
[
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"id" : "ninja::@6890427a1f51a3e7e1df",
|
||||
"link" :
|
||||
{
|
||||
"commandFragments" :
|
||||
[
|
||||
{
|
||||
"fragment" : "-g",
|
||||
"role" : "flags"
|
||||
},
|
||||
{
|
||||
"fragment" : "",
|
||||
"role" : "flags"
|
||||
},
|
||||
{
|
||||
"fragment" : "-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32",
|
||||
"role" : "libraries"
|
||||
}
|
||||
],
|
||||
"language" : "C"
|
||||
},
|
||||
"name" : "ninja",
|
||||
"nameOnDisk" : "ninja.exe",
|
||||
"paths" :
|
||||
{
|
||||
"build" : ".",
|
||||
"source" : "."
|
||||
},
|
||||
"sourceGroups" :
|
||||
[
|
||||
{
|
||||
"name" : "Source Files",
|
||||
"sourceIndexes" :
|
||||
[
|
||||
0
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "Header Files",
|
||||
"sourceIndexes" :
|
||||
[
|
||||
1
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources" :
|
||||
[
|
||||
{
|
||||
"backtrace" : 1,
|
||||
"compileGroupIndex" : 0,
|
||||
"path" : "njvm.c",
|
||||
"sourceGroupIndex" : 0
|
||||
},
|
||||
{
|
||||
"backtrace" : 1,
|
||||
"path" : "config.h.in",
|
||||
"sourceGroupIndex" : 1
|
||||
}
|
||||
],
|
||||
"type" : "EXECUTABLE"
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
{
|
||||
"kind" : "toolchains",
|
||||
"toolchains" :
|
||||
[
|
||||
{
|
||||
"compiler" :
|
||||
{
|
||||
"id" : "GNU",
|
||||
"implicit" :
|
||||
{
|
||||
"includeDirectories" :
|
||||
[
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include",
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/include",
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed",
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/x86_64-w64-mingw32/include"
|
||||
],
|
||||
"linkDirectories" :
|
||||
[
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0",
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc",
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/x86_64-w64-mingw32/lib",
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib"
|
||||
],
|
||||
"linkFrameworkDirectories" : [],
|
||||
"linkLibraries" :
|
||||
[
|
||||
"mingw32",
|
||||
"gcc",
|
||||
"moldname",
|
||||
"mingwex",
|
||||
"kernel32",
|
||||
"pthread",
|
||||
"advapi32",
|
||||
"shell32",
|
||||
"user32",
|
||||
"kernel32",
|
||||
"iconv",
|
||||
"mingw32",
|
||||
"gcc",
|
||||
"moldname",
|
||||
"mingwex",
|
||||
"kernel32"
|
||||
]
|
||||
},
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/gcc.exe",
|
||||
"version" : "11.2.0"
|
||||
},
|
||||
"language" : "C",
|
||||
"sourceFileExtensions" :
|
||||
[
|
||||
"c",
|
||||
"m"
|
||||
]
|
||||
},
|
||||
{
|
||||
"compiler" :
|
||||
{
|
||||
"implicit" : {},
|
||||
"path" : "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/windres.exe"
|
||||
},
|
||||
"language" : "RC",
|
||||
"sourceFileExtensions" :
|
||||
[
|
||||
"rc",
|
||||
"RC"
|
||||
]
|
||||
}
|
||||
],
|
||||
"version" :
|
||||
{
|
||||
"major" : 1,
|
||||
"minor" : 0
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,72 +0,0 @@
|
||||
set(CMAKE_C_COMPILER "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/gcc.exe")
|
||||
set(CMAKE_C_COMPILER_ARG1 "")
|
||||
set(CMAKE_C_COMPILER_ID "GNU")
|
||||
set(CMAKE_C_COMPILER_VERSION "11.2.0")
|
||||
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
|
||||
set(CMAKE_C_COMPILER_WRAPPER "")
|
||||
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17")
|
||||
set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON")
|
||||
set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23")
|
||||
set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
|
||||
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
|
||||
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
|
||||
set(CMAKE_C17_COMPILE_FEATURES "c_std_17")
|
||||
set(CMAKE_C23_COMPILE_FEATURES "c_std_23")
|
||||
|
||||
set(CMAKE_C_PLATFORM_ID "MinGW")
|
||||
set(CMAKE_C_SIMULATE_ID "")
|
||||
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "")
|
||||
set(CMAKE_C_SIMULATE_VERSION "")
|
||||
|
||||
|
||||
|
||||
|
||||
set(CMAKE_AR "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/ar.exe")
|
||||
set(CMAKE_C_COMPILER_AR "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/gcc-ar.exe")
|
||||
set(CMAKE_RANLIB "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/ranlib.exe")
|
||||
set(CMAKE_C_COMPILER_RANLIB "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/gcc-ranlib.exe")
|
||||
set(CMAKE_LINKER "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/ld.exe")
|
||||
set(CMAKE_MT "")
|
||||
set(CMAKE_COMPILER_IS_GNUCC 1)
|
||||
set(CMAKE_C_COMPILER_LOADED 1)
|
||||
set(CMAKE_C_COMPILER_WORKS TRUE)
|
||||
set(CMAKE_C_ABI_COMPILED TRUE)
|
||||
|
||||
set(CMAKE_C_COMPILER_ENV_VAR "CC")
|
||||
|
||||
set(CMAKE_C_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
|
||||
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
set(CMAKE_C_LINKER_PREFERENCE 10)
|
||||
|
||||
# Save compiler ABI information.
|
||||
set(CMAKE_C_SIZEOF_DATA_PTR "8")
|
||||
set(CMAKE_C_COMPILER_ABI "")
|
||||
set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN")
|
||||
set(CMAKE_C_LIBRARY_ARCHITECTURE "")
|
||||
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR)
|
||||
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ABI)
|
||||
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_LIBRARY_ARCHITECTURE)
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE "")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
|
||||
if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
|
||||
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include;C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/include;C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed;C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/x86_64-w64-mingw32/include")
|
||||
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "mingw32;gcc;moldname;mingwex;kernel32;pthread;advapi32;shell32;user32;kernel32;iconv;mingw32;gcc;moldname;mingwex;kernel32")
|
||||
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0;C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc;C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/x86_64-w64-mingw32/lib;C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib")
|
||||
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
|
||||
Binary file not shown.
@@ -1,6 +0,0 @@
|
||||
set(CMAKE_RC_COMPILER "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/windres.exe")
|
||||
set(CMAKE_RC_COMPILER_ARG1 "")
|
||||
set(CMAKE_RC_COMPILER_LOADED 1)
|
||||
set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc;RC)
|
||||
set(CMAKE_RC_OUTPUT_EXTENSION .obj)
|
||||
set(CMAKE_RC_COMPILER_ENV_VAR "RC")
|
||||
@@ -1,15 +0,0 @@
|
||||
set(CMAKE_HOST_SYSTEM "Windows-10.0.22621")
|
||||
set(CMAKE_HOST_SYSTEM_NAME "Windows")
|
||||
set(CMAKE_HOST_SYSTEM_VERSION "10.0.22621")
|
||||
set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64")
|
||||
|
||||
|
||||
|
||||
set(CMAKE_SYSTEM "Windows-10.0.22621")
|
||||
set(CMAKE_SYSTEM_NAME "Windows")
|
||||
set(CMAKE_SYSTEM_VERSION "10.0.22621")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "AMD64")
|
||||
|
||||
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||
|
||||
set(CMAKE_SYSTEM_LOADED 1)
|
||||
@@ -1,868 +0,0 @@
|
||||
#ifdef __cplusplus
|
||||
# error "A C++ compiler has been selected for C."
|
||||
#endif
|
||||
|
||||
#if defined(__18CXX)
|
||||
# define ID_VOID_MAIN
|
||||
#endif
|
||||
#if defined(__CLASSIC_C__)
|
||||
/* cv-qualifiers did not exist in K&R C */
|
||||
# define const
|
||||
# define volatile
|
||||
#endif
|
||||
|
||||
#if !defined(__has_include)
|
||||
/* If the compiler does not have __has_include, pretend the answer is
|
||||
always no. */
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number components: V=Version, R=Revision, P=Patch
|
||||
Version date components: YYYY=Year, MM=Month, DD=Day */
|
||||
|
||||
#if defined(__INTEL_COMPILER) || defined(__ICC)
|
||||
# define COMPILER_ID "Intel"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
# endif
|
||||
/* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
|
||||
except that a few beta releases use the old format with V=2021. */
|
||||
# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
||||
# if defined(__INTEL_COMPILER_UPDATE)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
||||
# else
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
||||
# endif
|
||||
# else
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
|
||||
/* The third version component from --version is an update index,
|
||||
but no macro is provided for it. */
|
||||
# define COMPILER_VERSION_PATCH DEC(0)
|
||||
# endif
|
||||
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
||||
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
||||
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
||||
# endif
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
# elif defined(__GNUG__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||
# endif
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
|
||||
# define COMPILER_ID "IntelLLVM"
|
||||
#if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
#endif
|
||||
/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
|
||||
* later. Look for 6 digit vs. 8 digit version number to decide encoding.
|
||||
* VVVV is no smaller than the current year when a version is released.
|
||||
*/
|
||||
#if __INTEL_LLVM_COMPILER < 1000000L
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
|
||||
#else
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
|
||||
#endif
|
||||
#if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
#elif defined(__GNUG__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||
#endif
|
||||
#if defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
#endif
|
||||
#if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
#endif
|
||||
|
||||
#elif defined(__PATHCC__)
|
||||
# define COMPILER_ID "PathScale"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
||||
# if defined(__PATHCC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
|
||||
# define COMPILER_ID "Embarcadero"
|
||||
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# define COMPILER_ID "Borland"
|
||||
/* __BORLANDC__ = 0xVRR */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||
|
||||
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
|
||||
# define COMPILER_ID "Watcom"
|
||||
/* __WATCOMC__ = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# define COMPILER_ID "OpenWatcom"
|
||||
/* __WATCOMC__ = VVRP + 1100 */
|
||||
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SUNPRO_C)
|
||||
# define COMPILER_ID "SunPro"
|
||||
# if __SUNPRO_C >= 0x5100
|
||||
/* __SUNPRO_C = 0xVRRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||
# else
|
||||
/* __SUNPRO_CC = 0xVRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||
# endif
|
||||
|
||||
#elif defined(__HP_cc)
|
||||
# define COMPILER_ID "HP"
|
||||
/* __HP_cc = VVRRPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
|
||||
|
||||
#elif defined(__DECC)
|
||||
# define COMPILER_ID "Compaq"
|
||||
/* __DECC_VER = VVRRTPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
|
||||
|
||||
#elif defined(__IBMC__) && defined(__COMPILER_VER__)
|
||||
# define COMPILER_ID "zOS"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__open_xl__) && defined(__clang__)
|
||||
# define COMPILER_ID "IBMClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
|
||||
|
||||
|
||||
#elif defined(__ibmxl__) && defined(__clang__)
|
||||
# define COMPILER_ID "XLClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
|
||||
|
||||
|
||||
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
|
||||
# define COMPILER_ID "XL"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
|
||||
# define COMPILER_ID "VisualAge"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__NVCOMPILER)
|
||||
# define COMPILER_ID "NVHPC"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
|
||||
# if defined(__NVCOMPILER_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__PGI)
|
||||
# define COMPILER_ID "PGI"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
||||
# if defined(__PGIC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_CRAYC)
|
||||
# define COMPILER_ID "Cray"
|
||||
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
|
||||
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
|
||||
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
# define COMPILER_ID "TI"
|
||||
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
|
||||
|
||||
#elif defined(__CLANG_FUJITSU)
|
||||
# define COMPILER_ID "FujitsuClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
|
||||
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
|
||||
|
||||
|
||||
#elif defined(__FUJITSU)
|
||||
# define COMPILER_ID "Fujitsu"
|
||||
# if defined(__FCC_version__)
|
||||
# define COMPILER_VERSION __FCC_version__
|
||||
# elif defined(__FCC_major__)
|
||||
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
|
||||
# endif
|
||||
# if defined(__fcc_version)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
|
||||
# elif defined(__FCC_VERSION)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
|
||||
# endif
|
||||
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# define COMPILER_ID "GHS"
|
||||
/* __GHS_VERSION_NUMBER = VVVVRP */
|
||||
# ifdef __GHS_VERSION_NUMBER
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__TASKING__)
|
||||
# define COMPILER_ID "Tasking"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__VERSION__)
|
||||
|
||||
#elif defined(__TINYC__)
|
||||
# define COMPILER_ID "TinyCC"
|
||||
|
||||
#elif defined(__BCC__)
|
||||
# define COMPILER_ID "Bruce"
|
||||
|
||||
#elif defined(__SCO_VERSION__)
|
||||
# define COMPILER_ID "SCO"
|
||||
|
||||
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
|
||||
# define COMPILER_ID "ARMCC"
|
||||
#if __ARMCC_VERSION >= 1000000
|
||||
/* __ARMCC_VERSION = VRRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#else
|
||||
/* __ARMCC_VERSION = VRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#endif
|
||||
|
||||
|
||||
#elif defined(__clang__) && defined(__apple_build_version__)
|
||||
# define COMPILER_ID "AppleClang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
|
||||
|
||||
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
|
||||
# define COMPILER_ID "ARMClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
|
||||
|
||||
#elif defined(__clang__)
|
||||
# define COMPILER_ID "Clang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
|
||||
#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
|
||||
# define COMPILER_ID "LCC"
|
||||
# define COMPILER_VERSION_MAJOR DEC(1)
|
||||
# if defined(__LCC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__LCC__- 100)
|
||||
# endif
|
||||
# if defined(__LCC_MINOR__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC__) && defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
# define COMPILER_ID "GNU"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# define COMPILER_ID "MSVC"
|
||||
/* _MSC_VER = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# if defined(_MSC_FULL_VER)
|
||||
# if _MSC_VER >= 1400
|
||||
/* _MSC_FULL_VER = VVRRPPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
||||
# else
|
||||
/* _MSC_FULL_VER = VVRRPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_MSC_BUILD)
|
||||
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
||||
# endif
|
||||
|
||||
#elif defined(_ADI_COMPILER)
|
||||
# define COMPILER_ID "ADSP"
|
||||
#if defined(__VERSIONNUM__)
|
||||
/* __VERSIONNUM__ = 0xVVRRPPTT */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
|
||||
# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
|
||||
#endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# define COMPILER_ID "IAR"
|
||||
# if defined(__VER__) && defined(__ICCARM__)
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
|
||||
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# endif
|
||||
|
||||
#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
|
||||
# define COMPILER_ID "SDCC"
|
||||
# if defined(__SDCC_VERSION_MAJOR)
|
||||
# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
|
||||
# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
|
||||
# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
|
||||
# else
|
||||
/* SDCC = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
|
||||
# endif
|
||||
|
||||
|
||||
/* These compilers are either not known or too old to define an
|
||||
identification macro. Try to identify the platform and guess that
|
||||
it is the native compiler. */
|
||||
#elif defined(__hpux) || defined(__hpua)
|
||||
# define COMPILER_ID "HP"
|
||||
|
||||
#else /* unknown compiler */
|
||||
# define COMPILER_ID ""
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
|
||||
#ifdef SIMULATE_ID
|
||||
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
||||
#endif
|
||||
|
||||
#ifdef __QNXNTO__
|
||||
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
||||
#endif
|
||||
|
||||
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||
#endif
|
||||
|
||||
#define STRINGIFY_HELPER(X) #X
|
||||
#define STRINGIFY(X) STRINGIFY_HELPER(X)
|
||||
|
||||
/* Identify known platforms by name. */
|
||||
#if defined(__linux) || defined(__linux__) || defined(linux)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
#elif defined(__MSYS__)
|
||||
# define PLATFORM_ID "MSYS"
|
||||
|
||||
#elif defined(__CYGWIN__)
|
||||
# define PLATFORM_ID "Cygwin"
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define PLATFORM_ID "MinGW"
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
# define PLATFORM_ID "Darwin"
|
||||
|
||||
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
||||
# define PLATFORM_ID "Windows"
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD)
|
||||
# define PLATFORM_ID "FreeBSD"
|
||||
|
||||
#elif defined(__NetBSD__) || defined(__NetBSD)
|
||||
# define PLATFORM_ID "NetBSD"
|
||||
|
||||
#elif defined(__OpenBSD__) || defined(__OPENBSD)
|
||||
# define PLATFORM_ID "OpenBSD"
|
||||
|
||||
#elif defined(__sun) || defined(sun)
|
||||
# define PLATFORM_ID "SunOS"
|
||||
|
||||
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
|
||||
# define PLATFORM_ID "AIX"
|
||||
|
||||
#elif defined(__hpux) || defined(__hpux__)
|
||||
# define PLATFORM_ID "HP-UX"
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
# define PLATFORM_ID "Haiku"
|
||||
|
||||
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
|
||||
# define PLATFORM_ID "BeOS"
|
||||
|
||||
#elif defined(__QNX__) || defined(__QNXNTO__)
|
||||
# define PLATFORM_ID "QNX"
|
||||
|
||||
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
|
||||
# define PLATFORM_ID "Tru64"
|
||||
|
||||
#elif defined(__riscos) || defined(__riscos__)
|
||||
# define PLATFORM_ID "RISCos"
|
||||
|
||||
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
|
||||
# define PLATFORM_ID "SINIX"
|
||||
|
||||
#elif defined(__UNIX_SV__)
|
||||
# define PLATFORM_ID "UNIX_SV"
|
||||
|
||||
#elif defined(__bsdos__)
|
||||
# define PLATFORM_ID "BSDOS"
|
||||
|
||||
#elif defined(_MPRAS) || defined(MPRAS)
|
||||
# define PLATFORM_ID "MP-RAS"
|
||||
|
||||
#elif defined(__osf) || defined(__osf__)
|
||||
# define PLATFORM_ID "OSF1"
|
||||
|
||||
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
|
||||
# define PLATFORM_ID "SCO_SV"
|
||||
|
||||
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
|
||||
# define PLATFORM_ID "ULTRIX"
|
||||
|
||||
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
|
||||
# define PLATFORM_ID "Xenix"
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__LINUX__)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
# elif defined(__DOS__)
|
||||
# define PLATFORM_ID "DOS"
|
||||
|
||||
# elif defined(__OS2__)
|
||||
# define PLATFORM_ID "OS2"
|
||||
|
||||
# elif defined(__WINDOWS__)
|
||||
# define PLATFORM_ID "Windows3x"
|
||||
|
||||
# elif defined(__VXWORKS__)
|
||||
# define PLATFORM_ID "VxWorks"
|
||||
|
||||
# else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
# endif
|
||||
|
||||
#elif defined(__INTEGRITY)
|
||||
# if defined(INT_178B)
|
||||
# define PLATFORM_ID "Integrity178"
|
||||
|
||||
# else /* regular Integrity */
|
||||
# define PLATFORM_ID "Integrity"
|
||||
# endif
|
||||
|
||||
# elif defined(_ADI_COMPILER)
|
||||
# define PLATFORM_ID "ADSP"
|
||||
|
||||
#else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
|
||||
#endif
|
||||
|
||||
/* For windows compilers MSVC and Intel we can determine
|
||||
the architecture of the compiler being used. This is because
|
||||
the compilers do not have flags that can change the architecture,
|
||||
but rather depend on which compiler is being used
|
||||
*/
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if defined(_M_IA64)
|
||||
# define ARCHITECTURE_ID "IA64"
|
||||
|
||||
# elif defined(_M_ARM64EC)
|
||||
# define ARCHITECTURE_ID "ARM64EC"
|
||||
|
||||
# elif defined(_M_X64) || defined(_M_AMD64)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# elif defined(_M_ARM64)
|
||||
# define ARCHITECTURE_ID "ARM64"
|
||||
|
||||
# elif defined(_M_ARM)
|
||||
# if _M_ARM == 4
|
||||
# define ARCHITECTURE_ID "ARMV4I"
|
||||
# elif _M_ARM == 5
|
||||
# define ARCHITECTURE_ID "ARMV5I"
|
||||
# else
|
||||
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
|
||||
# endif
|
||||
|
||||
# elif defined(_M_MIPS)
|
||||
# define ARCHITECTURE_ID "MIPS"
|
||||
|
||||
# elif defined(_M_SH)
|
||||
# define ARCHITECTURE_ID "SHx"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(_M_I86)
|
||||
# define ARCHITECTURE_ID "I86"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# if defined(__ICCARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__ICCRX__)
|
||||
# define ARCHITECTURE_ID "RX"
|
||||
|
||||
# elif defined(__ICCRH850__)
|
||||
# define ARCHITECTURE_ID "RH850"
|
||||
|
||||
# elif defined(__ICCRL78__)
|
||||
# define ARCHITECTURE_ID "RL78"
|
||||
|
||||
# elif defined(__ICCRISCV__)
|
||||
# define ARCHITECTURE_ID "RISCV"
|
||||
|
||||
# elif defined(__ICCAVR__)
|
||||
# define ARCHITECTURE_ID "AVR"
|
||||
|
||||
# elif defined(__ICC430__)
|
||||
# define ARCHITECTURE_ID "MSP430"
|
||||
|
||||
# elif defined(__ICCV850__)
|
||||
# define ARCHITECTURE_ID "V850"
|
||||
|
||||
# elif defined(__ICC8051__)
|
||||
# define ARCHITECTURE_ID "8051"
|
||||
|
||||
# elif defined(__ICCSTM8__)
|
||||
# define ARCHITECTURE_ID "STM8"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# if defined(__PPC64__)
|
||||
# define ARCHITECTURE_ID "PPC64"
|
||||
|
||||
# elif defined(__ppc__)
|
||||
# define ARCHITECTURE_ID "PPC"
|
||||
|
||||
# elif defined(__ARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__x86_64__)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(__i386__)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
# if defined(__TI_ARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__MSP430__)
|
||||
# define ARCHITECTURE_ID "MSP430"
|
||||
|
||||
# elif defined(__TMS320C28XX__)
|
||||
# define ARCHITECTURE_ID "TMS320C28x"
|
||||
|
||||
# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
|
||||
# define ARCHITECTURE_ID "TMS320C6x"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
# elif defined(__ADSPSHARC__)
|
||||
# define ARCHITECTURE_ID "SHARC"
|
||||
|
||||
# elif defined(__ADSPBLACKFIN__)
|
||||
# define ARCHITECTURE_ID "Blackfin"
|
||||
|
||||
#elif defined(__TASKING__)
|
||||
|
||||
# if defined(__CTC__) || defined(__CPTC__)
|
||||
# define ARCHITECTURE_ID "TriCore"
|
||||
|
||||
# elif defined(__CMCS__)
|
||||
# define ARCHITECTURE_ID "MCS"
|
||||
|
||||
# elif defined(__CARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__CARC__)
|
||||
# define ARCHITECTURE_ID "ARC"
|
||||
|
||||
# elif defined(__C51__)
|
||||
# define ARCHITECTURE_ID "8051"
|
||||
|
||||
# elif defined(__CPCP__)
|
||||
# define ARCHITECTURE_ID "PCP"
|
||||
|
||||
# else
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#else
|
||||
# define ARCHITECTURE_ID
|
||||
#endif
|
||||
|
||||
/* Convert integer to decimal digit literals. */
|
||||
#define DEC(n) \
|
||||
('0' + (((n) / 10000000)%10)), \
|
||||
('0' + (((n) / 1000000)%10)), \
|
||||
('0' + (((n) / 100000)%10)), \
|
||||
('0' + (((n) / 10000)%10)), \
|
||||
('0' + (((n) / 1000)%10)), \
|
||||
('0' + (((n) / 100)%10)), \
|
||||
('0' + (((n) / 10)%10)), \
|
||||
('0' + ((n) % 10))
|
||||
|
||||
/* Convert integer to hex digit literals. */
|
||||
#define HEX(n) \
|
||||
('0' + ((n)>>28 & 0xF)), \
|
||||
('0' + ((n)>>24 & 0xF)), \
|
||||
('0' + ((n)>>20 & 0xF)), \
|
||||
('0' + ((n)>>16 & 0xF)), \
|
||||
('0' + ((n)>>12 & 0xF)), \
|
||||
('0' + ((n)>>8 & 0xF)), \
|
||||
('0' + ((n)>>4 & 0xF)), \
|
||||
('0' + ((n) & 0xF))
|
||||
|
||||
/* Construct a string literal encoding the version number. */
|
||||
#ifdef COMPILER_VERSION
|
||||
char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#elif defined(COMPILER_VERSION_MAJOR)
|
||||
char const info_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
|
||||
COMPILER_VERSION_MAJOR,
|
||||
# ifdef COMPILER_VERSION_MINOR
|
||||
'.', COMPILER_VERSION_MINOR,
|
||||
# ifdef COMPILER_VERSION_PATCH
|
||||
'.', COMPILER_VERSION_PATCH,
|
||||
# ifdef COMPILER_VERSION_TWEAK
|
||||
'.', COMPILER_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the internal version number. */
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
char const info_version_internal[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
|
||||
'i','n','t','e','r','n','a','l','[',
|
||||
COMPILER_VERSION_INTERNAL,']','\0'};
|
||||
#elif defined(COMPILER_VERSION_INTERNAL_STR)
|
||||
char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
char const info_simulate_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
|
||||
SIMULATE_VERSION_MAJOR,
|
||||
# ifdef SIMULATE_VERSION_MINOR
|
||||
'.', SIMULATE_VERSION_MINOR,
|
||||
# ifdef SIMULATE_VERSION_PATCH
|
||||
'.', SIMULATE_VERSION_PATCH,
|
||||
# ifdef SIMULATE_VERSION_TWEAK
|
||||
'.', SIMULATE_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
|
||||
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
|
||||
|
||||
|
||||
|
||||
#if !defined(__STDC__) && !defined(__clang__)
|
||||
# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
|
||||
# define C_VERSION "90"
|
||||
# else
|
||||
# define C_VERSION
|
||||
# endif
|
||||
#elif __STDC_VERSION__ > 201710L
|
||||
# define C_VERSION "23"
|
||||
#elif __STDC_VERSION__ >= 201710L
|
||||
# define C_VERSION "17"
|
||||
#elif __STDC_VERSION__ >= 201000L
|
||||
# define C_VERSION "11"
|
||||
#elif __STDC_VERSION__ >= 199901L
|
||||
# define C_VERSION "99"
|
||||
#else
|
||||
# define C_VERSION "90"
|
||||
#endif
|
||||
const char* info_language_standard_default =
|
||||
"INFO" ":" "standard_default[" C_VERSION "]";
|
||||
|
||||
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
|
||||
#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
|
||||
defined(__TI_COMPILER_VERSION__)) && \
|
||||
!defined(__STRICT_ANSI__)
|
||||
"ON"
|
||||
#else
|
||||
"OFF"
|
||||
#endif
|
||||
"]";
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef ID_VOID_MAIN
|
||||
void main() {}
|
||||
#else
|
||||
# if defined(__CLASSIC_C__)
|
||||
int main(argc, argv) int argc; char *argv[];
|
||||
# else
|
||||
int main(int argc, char* argv[])
|
||||
# endif
|
||||
{
|
||||
int require = 0;
|
||||
require += info_compiler[argc];
|
||||
require += info_platform[argc];
|
||||
require += info_arch[argc];
|
||||
#ifdef COMPILER_VERSION_MAJOR
|
||||
require += info_version[argc];
|
||||
#endif
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
require += info_version_internal[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_ID
|
||||
require += info_simulate[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
require += info_simulate_version[argc];
|
||||
#endif
|
||||
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||
require += info_cray[argc];
|
||||
#endif
|
||||
require += info_language_standard_default[argc];
|
||||
require += info_language_extensions_default[argc];
|
||||
(void)argv;
|
||||
return require;
|
||||
}
|
||||
#endif
|
||||
Binary file not shown.
@@ -1,16 +0,0 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "MinGW Makefiles" Generator, CMake Version 3.25
|
||||
|
||||
# Relative path conversion top directories.
|
||||
set(CMAKE_RELATIVE_PATH_TOP_SOURCE "C:/Users/Nilss/CLionProjects/ninja")
|
||||
set(CMAKE_RELATIVE_PATH_TOP_BINARY "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug")
|
||||
|
||||
# Force unix paths in dependencies.
|
||||
set(CMAKE_FORCE_UNIX_PATHS 1)
|
||||
|
||||
|
||||
# The C and CXX include file regular expressions for this directory.
|
||||
set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
|
||||
set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
|
||||
set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
|
||||
set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
|
||||
@@ -1,230 +0,0 @@
|
||||
The system is: Windows - 10.0.22621 - AMD64
|
||||
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
|
||||
Compiler: C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/gcc.exe
|
||||
Build flags:
|
||||
Id flags:
|
||||
|
||||
The output was:
|
||||
0
|
||||
|
||||
|
||||
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.exe"
|
||||
|
||||
The C compiler identification is GNU, found in "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/CMakeFiles/3.25.2/CompilerIdC/a.exe"
|
||||
|
||||
Detecting C compiler ABI info compiled with the following output:
|
||||
Change Dir: C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/CMakeFiles/CMakeScratch/TryCompile-04r8wz
|
||||
|
||||
Run Build Command(s):C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f Makefile cmTC_be6eb/fast && C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f CMakeFiles\cmTC_be6eb.dir\build.make CMakeFiles/cmTC_be6eb.dir/build
|
||||
|
||||
mingw32-make[1]: Entering directory 'C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/CMakeFiles/CMakeScratch/TryCompile-04r8wz'
|
||||
|
||||
Building C object CMakeFiles/cmTC_be6eb.dir/CMakeCCompilerABI.c.obj
|
||||
|
||||
C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe -fdiagnostics-color=always -v -o CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.obj -c "C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\share\cmake-3.25\Modules\CMakeCCompilerABI.c"
|
||||
|
||||
Using built-in specs.
|
||||
|
||||
COLLECT_GCC=C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe
|
||||
|
||||
Target: x86_64-w64-mingw32
|
||||
|
||||
Configured with: ../gcc-11.2.0/configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --build=x86_64-alpine-linux-musl --prefix=/win --enable-checking=release --enable-fully-dynamic-string --enable-languages=c,c++ --enable-libatomic --enable-libgomp --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --enable-seh-exceptions --enable-shared --enable-static --enable-threads=posix --enable-version-specific-runtime-libs --disable-bootstrap --disable-graphite --disable-libada --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-libquadmath --disable-lto --disable-nls --disable-multilib --disable-rpath --disable-symvers --disable-werror --disable-win32-registry --with-gnu-as --with-gnu-ld --with-system-libiconv --with-system-libz --with-gmp=/win/makedepends --with-mpfr=/win/makedepends --with-mpc=/win/makedepends
|
||||
|
||||
Thread model: posix
|
||||
|
||||
Supported LTO compression algorithms: zlib
|
||||
|
||||
gcc version 11.2.0 (GCC)
|
||||
|
||||
COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-v' '-o' 'CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\cmTC_be6eb.dir\'
|
||||
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/cc1.exe -quiet -v -iprefix C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/ -D_REENTRANT C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\share\cmake-3.25\Modules\CMakeCCompilerABI.c -quiet -dumpdir CMakeFiles\cmTC_be6eb.dir\ -dumpbase CMakeCCompilerABI.c.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -fdiagnostics-color=always -o C:\Users\Nilss\AppData\Local\Temp\ccWSJGTn.s
|
||||
|
||||
GNU C17 (GCC) version 11.2.0 (x86_64-w64-mingw32)
|
||||
|
||||
compiled by GNU C version 11.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version none
|
||||
|
||||
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
|
||||
|
||||
ignoring duplicate directory "C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/include"
|
||||
|
||||
ignoring nonexistent directory "/win/include"
|
||||
|
||||
ignoring duplicate directory "C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/lib/gcc/../../include"
|
||||
|
||||
ignoring duplicate directory "C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed"
|
||||
|
||||
ignoring duplicate directory "C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/include"
|
||||
|
||||
ignoring nonexistent directory "/mingw/include"
|
||||
|
||||
#include "..." search starts here:
|
||||
|
||||
#include <...> search starts here:
|
||||
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include
|
||||
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include
|
||||
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed
|
||||
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/include
|
||||
|
||||
End of search list.
|
||||
|
||||
GNU C17 (GCC) version 11.2.0 (x86_64-w64-mingw32)
|
||||
|
||||
compiled by GNU C version 11.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version none
|
||||
|
||||
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
|
||||
|
||||
Compiler executable checksum: 23424b72d090e8b977a96775bde79257
|
||||
|
||||
COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-v' '-o' 'CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\cmTC_be6eb.dir\'
|
||||
|
||||
as -v -o CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.obj C:\Users\Nilss\AppData\Local\Temp\ccWSJGTn.s
|
||||
|
||||
GNU assembler version 2.37 (x86_64-w64-mingw32) using BFD version (GNU Binutils) 2.37
|
||||
|
||||
COMPILER_PATH=C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/
|
||||
|
||||
LIBRARY_PATH=C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../lib/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../
|
||||
|
||||
COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-v' '-o' 'CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.'
|
||||
|
||||
Linking C executable cmTC_be6eb.exe
|
||||
|
||||
"C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_be6eb.dir\link.txt --verbose=1
|
||||
|
||||
"C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe" -E rm -f CMakeFiles\cmTC_be6eb.dir/objects.a
|
||||
C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\ar.exe qc CMakeFiles\cmTC_be6eb.dir/objects.a @CMakeFiles\cmTC_be6eb.dir\objects1
|
||||
C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe -v -Wl,--whole-archive CMakeFiles\cmTC_be6eb.dir/objects.a -Wl,--no-whole-archive -o cmTC_be6eb.exe -Wl,--out-implib,libcmTC_be6eb.dll.a -Wl,--major-image-version,0,--minor-image-version,0
|
||||
Using built-in specs.
|
||||
|
||||
COLLECT_GCC=C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe
|
||||
|
||||
COLLECT_LTO_WRAPPER=C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/lto-wrapper.exe
|
||||
|
||||
Target: x86_64-w64-mingw32
|
||||
|
||||
Configured with: ../gcc-11.2.0/configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --build=x86_64-alpine-linux-musl --prefix=/win --enable-checking=release --enable-fully-dynamic-string --enable-languages=c,c++ --enable-libatomic --enable-libgomp --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --enable-seh-exceptions --enable-shared --enable-static --enable-threads=posix --enable-version-specific-runtime-libs --disable-bootstrap --disable-graphite --disable-libada --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-libquadmath --disable-lto --disable-nls --disable-multilib --disable-rpath --disable-symvers --disable-werror --disable-win32-registry --with-gnu-as --with-gnu-ld --with-system-libiconv --with-system-libz --with-gmp=/win/makedepends --with-mpfr=/win/makedepends --with-mpc=/win/makedepends
|
||||
|
||||
Thread model: posix
|
||||
|
||||
Supported LTO compression algorithms: zlib
|
||||
|
||||
gcc version 11.2.0 (GCC)
|
||||
|
||||
COMPILER_PATH=C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/
|
||||
|
||||
LIBRARY_PATH=C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../lib/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/;C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../
|
||||
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_be6eb.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_be6eb.'
|
||||
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/collect2.exe -m i386pep -Bdynamic -o cmTC_be6eb.exe C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/crtbegin.o -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0 -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../lib -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../.. --whole-archive CMakeFiles\cmTC_be6eb.dir/objects.a --no-whole-archive --out-implib libcmTC_be6eb.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -liconv -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/default-manifest.o C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/crtend.o
|
||||
|
||||
COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_be6eb.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_be6eb.'
|
||||
|
||||
mingw32-make[1]: Leaving directory 'C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/CMakeFiles/CMakeScratch/TryCompile-04r8wz'
|
||||
|
||||
|
||||
|
||||
|
||||
Parsed C implicit include dir info from above output: rv=done
|
||||
found start of include info
|
||||
found start of implicit include info
|
||||
add: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include]
|
||||
add: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include]
|
||||
add: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed]
|
||||
add: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/include]
|
||||
end of search list found
|
||||
collapse include dir [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include] ==> [C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include]
|
||||
collapse include dir [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include] ==> [C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/include]
|
||||
collapse include dir [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed] ==> [C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed]
|
||||
collapse include dir [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/include] ==> [C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/x86_64-w64-mingw32/include]
|
||||
implicit include dirs: [C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include;C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/include;C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed;C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/x86_64-w64-mingw32/include]
|
||||
|
||||
|
||||
Parsed C implicit link information from above output:
|
||||
link line regex: [^( *|.*[/\])(ld\.exe|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
|
||||
ignore line: [Change Dir: C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/CMakeFiles/CMakeScratch/TryCompile-04r8wz]
|
||||
ignore line: []
|
||||
ignore line: [Run Build Command(s):C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f Makefile cmTC_be6eb/fast && C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f CMakeFiles\cmTC_be6eb.dir\build.make CMakeFiles/cmTC_be6eb.dir/build]
|
||||
ignore line: [mingw32-make[1]: Entering directory 'C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/CMakeFiles/CMakeScratch/TryCompile-04r8wz']
|
||||
ignore line: [Building C object CMakeFiles/cmTC_be6eb.dir/CMakeCCompilerABI.c.obj]
|
||||
ignore line: [C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe -fdiagnostics-color=always -v -o CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.obj -c "C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\share\cmake-3.25\Modules\CMakeCCompilerABI.c"]
|
||||
ignore line: [Using built-in specs.]
|
||||
ignore line: [COLLECT_GCC=C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe]
|
||||
ignore line: [Target: x86_64-w64-mingw32]
|
||||
ignore line: [Configured with: ../gcc-11.2.0/configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --build=x86_64-alpine-linux-musl --prefix=/win --enable-checking=release --enable-fully-dynamic-string --enable-languages=c,c++ --enable-libatomic --enable-libgomp --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --enable-seh-exceptions --enable-shared --enable-static --enable-threads=posix --enable-version-specific-runtime-libs --disable-bootstrap --disable-graphite --disable-libada --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-libquadmath --disable-lto --disable-nls --disable-multilib --disable-rpath --disable-symvers --disable-werror --disable-win32-registry --with-gnu-as --with-gnu-ld --with-system-libiconv --with-system-libz --with-gmp=/win/makedepends --with-mpfr=/win/makedepends --with-mpc=/win/makedepends]
|
||||
ignore line: [Thread model: posix]
|
||||
ignore line: [Supported LTO compression algorithms: zlib]
|
||||
ignore line: [gcc version 11.2.0 (GCC) ]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-v' '-o' 'CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\cmTC_be6eb.dir\']
|
||||
ignore line: [ C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/cc1.exe -quiet -v -iprefix C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/ -D_REENTRANT C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\share\cmake-3.25\Modules\CMakeCCompilerABI.c -quiet -dumpdir CMakeFiles\cmTC_be6eb.dir\ -dumpbase CMakeCCompilerABI.c.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -fdiagnostics-color=always -o C:\Users\Nilss\AppData\Local\Temp\ccWSJGTn.s]
|
||||
ignore line: [GNU C17 (GCC) version 11.2.0 (x86_64-w64-mingw32)]
|
||||
ignore line: [ compiled by GNU C version 11.2.0 GMP version 6.2.1 MPFR version 4.1.0 MPC version 1.2.1 isl version none]
|
||||
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
|
||||
ignore line: [ignoring duplicate directory "C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/include"]
|
||||
ignore line: [ignoring nonexistent directory "/win/include"]
|
||||
ignore line: [ignoring duplicate directory "C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/lib/gcc/../../include"]
|
||||
ignore line: [ignoring duplicate directory "C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed"]
|
||||
ignore line: [ignoring duplicate directory "C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/include"]
|
||||
ignore line: [ignoring nonexistent directory "/mingw/include"]
|
||||
ignore line: [#include "..." search starts here:]
|
||||
ignore line: [#include <...> search starts here:]
|
||||
ignore line: [ C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include]
|
||||
ignore line: [ C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include]
|
||||
ignore line: [ C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed]
|
||||
ignore line: [ C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/include]
|
||||
ignore line: [End of search list.]
|
||||
ignore line: [GNU C17 (GCC) version 11.2.0 (x86_64-w64-mingw32)]
|
||||
ignore line: [ compiled by GNU C version 11.2.0 GMP version 6.2.1 MPFR version 4.1.0 MPC version 1.2.1 isl version none]
|
||||
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
|
||||
ignore line: [Compiler executable checksum: 23424b72d090e8b977a96775bde79257]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-v' '-o' 'CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\cmTC_be6eb.dir\']
|
||||
ignore line: [ as -v -o CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.obj C:\Users\Nilss\AppData\Local\Temp\ccWSJGTn.s]
|
||||
ignore line: [GNU assembler version 2.37 (x86_64-w64-mingw32) using BFD version (GNU Binutils) 2.37]
|
||||
ignore line: [COMPILER_PATH=C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/]
|
||||
ignore line: [LIBRARY_PATH=C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../lib/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-v' '-o' 'CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64' '-dumpdir' 'CMakeFiles\cmTC_be6eb.dir\CMakeCCompilerABI.c.']
|
||||
ignore line: [Linking C executable cmTC_be6eb.exe]
|
||||
ignore line: ["C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_be6eb.dir\link.txt --verbose=1]
|
||||
ignore line: ["C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe" -E rm -f CMakeFiles\cmTC_be6eb.dir/objects.a]
|
||||
ignore line: [C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\ar.exe qc CMakeFiles\cmTC_be6eb.dir/objects.a @CMakeFiles\cmTC_be6eb.dir\objects1]
|
||||
ignore line: [C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe -v -Wl --whole-archive CMakeFiles\cmTC_be6eb.dir/objects.a -Wl --no-whole-archive -o cmTC_be6eb.exe -Wl --out-implib libcmTC_be6eb.dll.a -Wl --major-image-version 0 --minor-image-version 0 ]
|
||||
ignore line: [Using built-in specs.]
|
||||
ignore line: [COLLECT_GCC=C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe]
|
||||
ignore line: [COLLECT_LTO_WRAPPER=C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/lto-wrapper.exe]
|
||||
ignore line: [Target: x86_64-w64-mingw32]
|
||||
ignore line: [Configured with: ../gcc-11.2.0/configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --build=x86_64-alpine-linux-musl --prefix=/win --enable-checking=release --enable-fully-dynamic-string --enable-languages=c,c++ --enable-libatomic --enable-libgomp --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --enable-seh-exceptions --enable-shared --enable-static --enable-threads=posix --enable-version-specific-runtime-libs --disable-bootstrap --disable-graphite --disable-libada --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-libquadmath --disable-lto --disable-nls --disable-multilib --disable-rpath --disable-symvers --disable-werror --disable-win32-registry --with-gnu-as --with-gnu-ld --with-system-libiconv --with-system-libz --with-gmp=/win/makedepends --with-mpfr=/win/makedepends --with-mpc=/win/makedepends]
|
||||
ignore line: [Thread model: posix]
|
||||
ignore line: [Supported LTO compression algorithms: zlib]
|
||||
ignore line: [gcc version 11.2.0 (GCC) ]
|
||||
ignore line: [COMPILER_PATH=C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/]
|
||||
ignore line: [LIBRARY_PATH=C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../lib/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/]
|
||||
ignore line: [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../]
|
||||
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_be6eb.exe' '-mtune=generic' '-march=x86-64' '-dumpdir' 'cmTC_be6eb.']
|
||||
link line: [ C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/collect2.exe -m i386pep -Bdynamic -o cmTC_be6eb.exe C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/crtbegin.o -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0 -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../lib -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib -LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../.. --whole-archive CMakeFiles\cmTC_be6eb.dir/objects.a --no-whole-archive --out-implib libcmTC_be6eb.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -liconv -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lkernel32 C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/default-manifest.o C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/crtend.o]
|
||||
arg [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/collect2.exe] ==> ignore
|
||||
arg [-m] ==> ignore
|
||||
arg [i386pep] ==> ignore
|
||||
arg [-Bdynamic] ==> search dynamic
|
||||
arg [-o] ==> ignore
|
||||
arg [cmTC_be6eb.exe] ==> ignore
|
||||
arg [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o] ==> obj [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o]
|
||||
arg [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/crtbegin.o] ==> obj [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/crtbegin.o]
|
||||
arg [-LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0] ==> dir [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0]
|
||||
arg [-LC:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc] ==> dir [C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/../lib/gcc]
|
||||
@@ -1,52 +0,0 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "MinGW Makefiles" Generator, CMake Version 3.25
|
||||
|
||||
# The generator used is:
|
||||
set(CMAKE_DEPENDS_GENERATOR "MinGW Makefiles")
|
||||
|
||||
# The top level Makefile was generated from the following files:
|
||||
set(CMAKE_MAKEFILE_DEPENDS
|
||||
"CMakeCache.txt"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeCInformation.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeCommonLanguageInclude.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeFindCodeBlocks.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeGenericSystem.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeInitializeConfigs.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeLanguageInformation.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeRCInformation.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeSystemSpecificInformation.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/CMakeSystemSpecificInitialize.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Compiler/CMakeCommonCompilerMacros.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Compiler/GNU-C.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Compiler/GNU.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/Windows-GNU-C-ABI.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/Windows-GNU-C.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/Windows-GNU.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/Windows-windres.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/Windows.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/Platform/WindowsPaths.cmake"
|
||||
"C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/cmake/win/x64/share/cmake-3.25/Modules/ProcessorCount.cmake"
|
||||
"C:/Users/Nilss/CLionProjects/ninja/CMakeLists.txt"
|
||||
"CMakeFiles/3.25.2/CMakeCCompiler.cmake"
|
||||
"CMakeFiles/3.25.2/CMakeRCCompiler.cmake"
|
||||
"CMakeFiles/3.25.2/CMakeSystem.cmake"
|
||||
"C:/Users/Nilss/CLionProjects/ninja/config.h.in"
|
||||
)
|
||||
|
||||
# The corresponding makefile is:
|
||||
set(CMAKE_MAKEFILE_OUTPUTS
|
||||
"Makefile"
|
||||
"CMakeFiles/cmake.check_cache"
|
||||
)
|
||||
|
||||
# Byproducts of CMake generate step:
|
||||
set(CMAKE_MAKEFILE_PRODUCTS
|
||||
"config.h"
|
||||
"CMakeFiles/CMakeDirectoryInformation.cmake"
|
||||
)
|
||||
|
||||
# Dependency information for all targets:
|
||||
set(CMAKE_DEPEND_INFO_FILES
|
||||
"CMakeFiles/ninja.dir/DependInfo.cmake"
|
||||
)
|
||||
@@ -1,111 +0,0 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "MinGW Makefiles" Generator, CMake Version 3.25
|
||||
|
||||
# Default target executed when no arguments are given to make.
|
||||
default_target: all
|
||||
.PHONY : default_target
|
||||
|
||||
#=============================================================================
|
||||
# Special targets provided by cmake.
|
||||
|
||||
# Disable implicit rules so canonical targets will work.
|
||||
.SUFFIXES:
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : %,v
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : RCS/%
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : RCS/%,v
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : SCCS/s.%
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : s.%
|
||||
|
||||
.SUFFIXES: .hpux_make_needs_suffix_list
|
||||
|
||||
# Command-line flag to silence nested $(MAKE).
|
||||
$(VERBOSE)MAKESILENT = -s
|
||||
|
||||
#Suppress display of executed commands.
|
||||
$(VERBOSE).SILENT:
|
||||
|
||||
# A target that is always out of date.
|
||||
cmake_force:
|
||||
.PHONY : cmake_force
|
||||
|
||||
#=============================================================================
|
||||
# Set environment variables for the build.
|
||||
|
||||
SHELL = cmd.exe
|
||||
|
||||
# The CMake executable.
|
||||
CMAKE_COMMAND = "C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe"
|
||||
|
||||
# The command to remove a file.
|
||||
RM = "C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe" -E rm -f
|
||||
|
||||
# Escaping for special characters.
|
||||
EQUALS = =
|
||||
|
||||
# The top-level source directory on which CMake was run.
|
||||
CMAKE_SOURCE_DIR = C:\Users\Nilss\CLionProjects\ninja
|
||||
|
||||
# The top-level build directory on which CMake was run.
|
||||
CMAKE_BINARY_DIR = C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug
|
||||
|
||||
#=============================================================================
|
||||
# Directory level rules for the build root directory
|
||||
|
||||
# The main recursive "all" target.
|
||||
all: CMakeFiles/ninja.dir/all
|
||||
.PHONY : all
|
||||
|
||||
# The main recursive "preinstall" target.
|
||||
preinstall:
|
||||
.PHONY : preinstall
|
||||
|
||||
# The main recursive "clean" target.
|
||||
clean: CMakeFiles/ninja.dir/clean
|
||||
.PHONY : clean
|
||||
|
||||
#=============================================================================
|
||||
# Target rules for target CMakeFiles/ninja.dir
|
||||
|
||||
# All Build rule for target.
|
||||
CMakeFiles/ninja.dir/all:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\ninja.dir\build.make CMakeFiles/ninja.dir/depend
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\ninja.dir\build.make CMakeFiles/ninja.dir/build
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug\CMakeFiles --progress-num=1,2 "Built target ninja"
|
||||
.PHONY : CMakeFiles/ninja.dir/all
|
||||
|
||||
# Build rule for subdir invocation for target.
|
||||
CMakeFiles/ninja.dir/rule: cmake_check_build_system
|
||||
$(CMAKE_COMMAND) -E cmake_progress_start C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug\CMakeFiles 2
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 CMakeFiles/ninja.dir/all
|
||||
$(CMAKE_COMMAND) -E cmake_progress_start C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug\CMakeFiles 0
|
||||
.PHONY : CMakeFiles/ninja.dir/rule
|
||||
|
||||
# Convenience name for target.
|
||||
ninja: CMakeFiles/ninja.dir/rule
|
||||
.PHONY : ninja
|
||||
|
||||
# clean rule for target.
|
||||
CMakeFiles/ninja.dir/clean:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\ninja.dir\build.make CMakeFiles/ninja.dir/clean
|
||||
.PHONY : CMakeFiles/ninja.dir/clean
|
||||
|
||||
#=============================================================================
|
||||
# Special targets to cleanup operation of make.
|
||||
|
||||
# Special rule to run CMake to check the build system integrity.
|
||||
# No rule that depends on this can have commands that come from listfiles
|
||||
# because they might be regenerated.
|
||||
cmake_check_build_system:
|
||||
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 0
|
||||
.PHONY : cmake_check_build_system
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/CMakeFiles/ninja.dir
|
||||
C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/CMakeFiles/edit_cache.dir
|
||||
C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/CMakeFiles/rebuild_cache.dir
|
||||
@@ -1,4 +0,0 @@
|
||||
"C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - MinGW Makefiles" -S C:\Users\Nilss\CLionProjects\ninja -B C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug
|
||||
-- Configuring done
|
||||
-- Generating done
|
||||
-- Build files have been written to: C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug
|
||||
@@ -1,4 +0,0 @@
|
||||
ToolSet: w64 9.0 (local)@C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\mingw
|
||||
Options:
|
||||
|
||||
Options:
|
||||
@@ -1 +0,0 @@
|
||||
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
|
||||
@@ -1,19 +0,0 @@
|
||||
|
||||
# Consider dependencies only in project.
|
||||
set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF)
|
||||
|
||||
# The set of languages for which implicit dependencies are needed:
|
||||
set(CMAKE_DEPENDS_LANGUAGES
|
||||
)
|
||||
|
||||
# The set of dependency files which are needed:
|
||||
set(CMAKE_DEPENDS_DEPENDENCY_FILES
|
||||
"C:/Users/Nilss/CLionProjects/ninja/njvm.c" "CMakeFiles/ninja.dir/njvm.c.obj" "gcc" "CMakeFiles/ninja.dir/njvm.c.obj.d"
|
||||
)
|
||||
|
||||
# Targets to which this target links.
|
||||
set(CMAKE_TARGET_LINKED_INFO_FILES
|
||||
)
|
||||
|
||||
# Fortran module output directory.
|
||||
set(CMAKE_Fortran_TARGET_MODULE_DIR "")
|
||||
@@ -1,112 +0,0 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "MinGW Makefiles" Generator, CMake Version 3.25
|
||||
|
||||
# Delete rule output on recipe failure.
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
#=============================================================================
|
||||
# Special targets provided by cmake.
|
||||
|
||||
# Disable implicit rules so canonical targets will work.
|
||||
.SUFFIXES:
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : %,v
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : RCS/%
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : RCS/%,v
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : SCCS/s.%
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : s.%
|
||||
|
||||
.SUFFIXES: .hpux_make_needs_suffix_list
|
||||
|
||||
# Command-line flag to silence nested $(MAKE).
|
||||
$(VERBOSE)MAKESILENT = -s
|
||||
|
||||
#Suppress display of executed commands.
|
||||
$(VERBOSE).SILENT:
|
||||
|
||||
# A target that is always out of date.
|
||||
cmake_force:
|
||||
.PHONY : cmake_force
|
||||
|
||||
#=============================================================================
|
||||
# Set environment variables for the build.
|
||||
|
||||
SHELL = cmd.exe
|
||||
|
||||
# The CMake executable.
|
||||
CMAKE_COMMAND = "C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe"
|
||||
|
||||
# The command to remove a file.
|
||||
RM = "C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe" -E rm -f
|
||||
|
||||
# Escaping for special characters.
|
||||
EQUALS = =
|
||||
|
||||
# The top-level source directory on which CMake was run.
|
||||
CMAKE_SOURCE_DIR = C:\Users\Nilss\CLionProjects\ninja
|
||||
|
||||
# The top-level build directory on which CMake was run.
|
||||
CMAKE_BINARY_DIR = C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug
|
||||
|
||||
# Include any dependencies generated for this target.
|
||||
include CMakeFiles/ninja.dir/depend.make
|
||||
# Include any dependencies generated by the compiler for this target.
|
||||
include CMakeFiles/ninja.dir/compiler_depend.make
|
||||
|
||||
# Include the progress variables for this target.
|
||||
include CMakeFiles/ninja.dir/progress.make
|
||||
|
||||
# Include the compile flags for this target's objects.
|
||||
include CMakeFiles/ninja.dir/flags.make
|
||||
|
||||
CMakeFiles/ninja.dir/njvm.c.obj: CMakeFiles/ninja.dir/flags.make
|
||||
CMakeFiles/ninja.dir/njvm.c.obj: CMakeFiles/ninja.dir/includes_C.rsp
|
||||
CMakeFiles/ninja.dir/njvm.c.obj: C:/Users/Nilss/CLionProjects/ninja/njvm.c
|
||||
CMakeFiles/ninja.dir/njvm.c.obj: CMakeFiles/ninja.dir/compiler_depend.ts
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug\CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object CMakeFiles/ninja.dir/njvm.c.obj"
|
||||
C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/ninja.dir/njvm.c.obj -MF CMakeFiles\ninja.dir\njvm.c.obj.d -o CMakeFiles\ninja.dir\njvm.c.obj -c C:\Users\Nilss\CLionProjects\ninja\njvm.c
|
||||
|
||||
CMakeFiles/ninja.dir/njvm.c.i: cmake_force
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/ninja.dir/njvm.c.i"
|
||||
C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E C:\Users\Nilss\CLionProjects\ninja\njvm.c > CMakeFiles\ninja.dir\njvm.c.i
|
||||
|
||||
CMakeFiles/ninja.dir/njvm.c.s: cmake_force
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/ninja.dir/njvm.c.s"
|
||||
C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S C:\Users\Nilss\CLionProjects\ninja\njvm.c -o CMakeFiles\ninja.dir\njvm.c.s
|
||||
|
||||
# Object files for target ninja
|
||||
ninja_OBJECTS = \
|
||||
"CMakeFiles/ninja.dir/njvm.c.obj"
|
||||
|
||||
# External object files for target ninja
|
||||
ninja_EXTERNAL_OBJECTS =
|
||||
|
||||
ninja.exe: CMakeFiles/ninja.dir/njvm.c.obj
|
||||
ninja.exe: CMakeFiles/ninja.dir/build.make
|
||||
ninja.exe: CMakeFiles/ninja.dir/linkLibs.rsp
|
||||
ninja.exe: CMakeFiles/ninja.dir/objects1
|
||||
ninja.exe: CMakeFiles/ninja.dir/link.txt
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug\CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking C executable ninja.exe"
|
||||
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles\ninja.dir\link.txt --verbose=$(VERBOSE)
|
||||
|
||||
# Rule to build all files generated by this target.
|
||||
CMakeFiles/ninja.dir/build: ninja.exe
|
||||
.PHONY : CMakeFiles/ninja.dir/build
|
||||
|
||||
CMakeFiles/ninja.dir/clean:
|
||||
$(CMAKE_COMMAND) -P CMakeFiles\ninja.dir\cmake_clean.cmake
|
||||
.PHONY : CMakeFiles/ninja.dir/clean
|
||||
|
||||
CMakeFiles/ninja.dir/depend:
|
||||
$(CMAKE_COMMAND) -E cmake_depends "MinGW Makefiles" C:\Users\Nilss\CLionProjects\ninja C:\Users\Nilss\CLionProjects\ninja C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug\CMakeFiles\ninja.dir\DependInfo.cmake --color=$(COLOR)
|
||||
.PHONY : CMakeFiles/ninja.dir/depend
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
file(REMOVE_RECURSE
|
||||
"CMakeFiles/ninja.dir/njvm.c.obj"
|
||||
"CMakeFiles/ninja.dir/njvm.c.obj.d"
|
||||
"libninja.dll.a"
|
||||
"ninja.exe"
|
||||
"ninja.exe.manifest"
|
||||
"ninja.pdb"
|
||||
)
|
||||
|
||||
# Per-language clean rules from dependency scanning.
|
||||
foreach(lang C)
|
||||
include(CMakeFiles/ninja.dir/cmake_clean_${lang}.cmake OPTIONAL)
|
||||
endforeach()
|
||||
@@ -1,2 +0,0 @@
|
||||
# Empty compiler generated dependencies file for ninja.
|
||||
# This may be replaced when dependencies are built.
|
||||
@@ -1,2 +0,0 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Timestamp file for compiler generated dependencies management for ninja.
|
||||
@@ -1,2 +0,0 @@
|
||||
# Empty dependencies file for ninja.
|
||||
# This may be replaced when dependencies are built.
|
||||
@@ -1,10 +0,0 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "MinGW Makefiles" Generator, CMake Version 3.25
|
||||
|
||||
# compile C with C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/gcc.exe
|
||||
C_DEFINES =
|
||||
|
||||
C_INCLUDES = @CMakeFiles/ninja.dir/includes_C.rsp
|
||||
|
||||
C_FLAGS = -g -fdiagnostics-color=always -std=gnu99
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
-I"C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug"
|
||||
@@ -1,3 +0,0 @@
|
||||
"C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe" -E rm -f CMakeFiles\ninja.dir/objects.a
|
||||
C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\ar.exe qc CMakeFiles\ninja.dir/objects.a @CMakeFiles\ninja.dir\objects1
|
||||
C:\PROGRA~2\JETBRA~1\CLION2~1.5\bin\mingw\bin\gcc.exe -g -Wl,--whole-archive CMakeFiles\ninja.dir/objects.a -Wl,--no-whole-archive -o ninja.exe -Wl,--out-implib,libninja.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\ninja.dir\linkLibs.rsp
|
||||
@@ -1 +0,0 @@
|
||||
-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
|
||||
Binary file not shown.
@@ -1,17 +0,0 @@
|
||||
CMakeFiles/ninja.dir/njvm.c.obj: \
|
||||
C:\Users\Nilss\CLionProjects\ninja\njvm.c \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/stdio.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/corecrt_stdio_config.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/corecrt.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/_mingw.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/_mingw_mac.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/_mingw_secapi.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/vadefs.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/sdks/_mingw_ddk.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/_mingw_off_t.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/swprintf.inl \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/sec_api/stdio_s.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/string.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/crtdefs.h \
|
||||
C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/x86_64-w64-mingw32/include/sec_api/string_s.h \
|
||||
C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/config.h
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
CMakeFiles/ninja.dir/njvm.c.obj
|
||||
@@ -1,3 +0,0 @@
|
||||
CMAKE_PROGRESS_1 = 1
|
||||
CMAKE_PROGRESS_2 = 2
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
2
|
||||
@@ -1,180 +0,0 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "MinGW Makefiles" Generator, CMake Version 3.25
|
||||
|
||||
# Default target executed when no arguments are given to make.
|
||||
default_target: all
|
||||
.PHONY : default_target
|
||||
|
||||
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
|
||||
.NOTPARALLEL:
|
||||
|
||||
#=============================================================================
|
||||
# Special targets provided by cmake.
|
||||
|
||||
# Disable implicit rules so canonical targets will work.
|
||||
.SUFFIXES:
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : %,v
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : RCS/%
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : RCS/%,v
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : SCCS/s.%
|
||||
|
||||
# Disable VCS-based implicit rules.
|
||||
% : s.%
|
||||
|
||||
.SUFFIXES: .hpux_make_needs_suffix_list
|
||||
|
||||
# Command-line flag to silence nested $(MAKE).
|
||||
$(VERBOSE)MAKESILENT = -s
|
||||
|
||||
#Suppress display of executed commands.
|
||||
$(VERBOSE).SILENT:
|
||||
|
||||
# A target that is always out of date.
|
||||
cmake_force:
|
||||
.PHONY : cmake_force
|
||||
|
||||
#=============================================================================
|
||||
# Set environment variables for the build.
|
||||
|
||||
SHELL = cmd.exe
|
||||
|
||||
# The CMake executable.
|
||||
CMAKE_COMMAND = "C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe"
|
||||
|
||||
# The command to remove a file.
|
||||
RM = "C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe" -E rm -f
|
||||
|
||||
# Escaping for special characters.
|
||||
EQUALS = =
|
||||
|
||||
# The top-level source directory on which CMake was run.
|
||||
CMAKE_SOURCE_DIR = C:\Users\Nilss\CLionProjects\ninja
|
||||
|
||||
# The top-level build directory on which CMake was run.
|
||||
CMAKE_BINARY_DIR = C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug
|
||||
|
||||
#=============================================================================
|
||||
# Targets provided globally by CMake.
|
||||
|
||||
# Special rule for the target edit_cache
|
||||
edit_cache:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
|
||||
"C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe" -E echo "No interactive CMake dialog available."
|
||||
.PHONY : edit_cache
|
||||
|
||||
# Special rule for the target edit_cache
|
||||
edit_cache/fast: edit_cache
|
||||
.PHONY : edit_cache/fast
|
||||
|
||||
# Special rule for the target rebuild_cache
|
||||
rebuild_cache:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
|
||||
"C:\Program Files (x86)\JetBrains\CLion 2023.1.5\bin\cmake\win\x64\bin\cmake.exe" --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
||||
.PHONY : rebuild_cache
|
||||
|
||||
# Special rule for the target rebuild_cache
|
||||
rebuild_cache/fast: rebuild_cache
|
||||
.PHONY : rebuild_cache/fast
|
||||
|
||||
# The main all target
|
||||
all: cmake_check_build_system
|
||||
$(CMAKE_COMMAND) -E cmake_progress_start C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug\CMakeFiles C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug\\CMakeFiles\progress.marks
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 all
|
||||
$(CMAKE_COMMAND) -E cmake_progress_start C:\Users\Nilss\CLionProjects\ninja\cmake-build-debug\CMakeFiles 0
|
||||
.PHONY : all
|
||||
|
||||
# The main clean target
|
||||
clean:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 clean
|
||||
.PHONY : clean
|
||||
|
||||
# The main clean target
|
||||
clean/fast: clean
|
||||
.PHONY : clean/fast
|
||||
|
||||
# Prepare targets for installation.
|
||||
preinstall: all
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 preinstall
|
||||
.PHONY : preinstall
|
||||
|
||||
# Prepare targets for installation.
|
||||
preinstall/fast:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 preinstall
|
||||
.PHONY : preinstall/fast
|
||||
|
||||
# clear depends
|
||||
depend:
|
||||
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 1
|
||||
.PHONY : depend
|
||||
|
||||
#=============================================================================
|
||||
# Target rules for targets named ninja
|
||||
|
||||
# Build rule for target.
|
||||
ninja: cmake_check_build_system
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\Makefile2 ninja
|
||||
.PHONY : ninja
|
||||
|
||||
# fast build rule for target.
|
||||
ninja/fast:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\ninja.dir\build.make CMakeFiles/ninja.dir/build
|
||||
.PHONY : ninja/fast
|
||||
|
||||
njvm.obj: njvm.c.obj
|
||||
.PHONY : njvm.obj
|
||||
|
||||
# target to build an object file
|
||||
njvm.c.obj:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\ninja.dir\build.make CMakeFiles/ninja.dir/njvm.c.obj
|
||||
.PHONY : njvm.c.obj
|
||||
|
||||
njvm.i: njvm.c.i
|
||||
.PHONY : njvm.i
|
||||
|
||||
# target to preprocess a source file
|
||||
njvm.c.i:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\ninja.dir\build.make CMakeFiles/ninja.dir/njvm.c.i
|
||||
.PHONY : njvm.c.i
|
||||
|
||||
njvm.s: njvm.c.s
|
||||
.PHONY : njvm.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
njvm.c.s:
|
||||
$(MAKE) $(MAKESILENT) -f CMakeFiles\ninja.dir\build.make CMakeFiles/ninja.dir/njvm.c.s
|
||||
.PHONY : njvm.c.s
|
||||
|
||||
# Help Target
|
||||
help:
|
||||
@echo The following are some of the valid targets for this Makefile:
|
||||
@echo ... all (the default if no target is provided)
|
||||
@echo ... clean
|
||||
@echo ... depend
|
||||
@echo ... edit_cache
|
||||
@echo ... rebuild_cache
|
||||
@echo ... ninja
|
||||
@echo ... njvm.obj
|
||||
@echo ... njvm.i
|
||||
@echo ... njvm.s
|
||||
.PHONY : help
|
||||
|
||||
|
||||
|
||||
#=============================================================================
|
||||
# Special targets to cleanup operation of make.
|
||||
|
||||
# Special rule to run CMake to check the build system integrity.
|
||||
# No rule that depends on this can have commands that come from listfiles
|
||||
# because they might be regenerated.
|
||||
cmake_check_build_system:
|
||||
$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 0
|
||||
.PHONY : cmake_check_build_system
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
Start testing: Oct 12 12:13 Mitteleuropäische Sommerzeit
|
||||
----------------------------------------------------------
|
||||
End testing: Oct 12 12:13 Mitteleuropäische Sommerzeit
|
||||
@@ -1,49 +0,0 @@
|
||||
# Install script for directory: C:/Users/Nilss/CLionProjects/ninja
|
||||
|
||||
# Set the install prefix
|
||||
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||
set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/ninja")
|
||||
endif()
|
||||
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
# Set the install configuration name.
|
||||
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
|
||||
if(BUILD_TYPE)
|
||||
string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
|
||||
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_CONFIG_NAME "Debug")
|
||||
endif()
|
||||
message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
|
||||
endif()
|
||||
|
||||
# Set the component getting installed.
|
||||
if(NOT CMAKE_INSTALL_COMPONENT)
|
||||
if(COMPONENT)
|
||||
message(STATUS "Install component: \"${COMPONENT}\"")
|
||||
set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
|
||||
else()
|
||||
set(CMAKE_INSTALL_COMPONENT)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Is this installation the result of a crosscompile?
|
||||
if(NOT DEFINED CMAKE_CROSSCOMPILING)
|
||||
set(CMAKE_CROSSCOMPILING "FALSE")
|
||||
endif()
|
||||
|
||||
# Set default install directory permissions.
|
||||
if(NOT DEFINED CMAKE_OBJDUMP)
|
||||
set(CMAKE_OBJDUMP "C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/objdump.exe")
|
||||
endif()
|
||||
|
||||
if(CMAKE_INSTALL_COMPONENT)
|
||||
set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
|
||||
else()
|
||||
set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
|
||||
endif()
|
||||
|
||||
string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
|
||||
"${CMAKE_INSTALL_MANIFEST_FILES}")
|
||||
file(WRITE "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/${CMAKE_INSTALL_MANIFEST}"
|
||||
"${CMAKE_INSTALL_MANIFEST_CONTENT}")
|
||||
@@ -1 +0,0 @@
|
||||
#define PROJECT_VERSION 0
|
||||
@@ -1,94 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6"/>
|
||||
<Project>
|
||||
<Option title="ninja"/>
|
||||
<Option makefile_is_custom="1"/>
|
||||
<Option compiler="gcc"/>
|
||||
<Option virtualFolders="CMake Files\;"/>
|
||||
<Build>
|
||||
<Target title="all">
|
||||
<Option working_dir="C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug"/>
|
||||
<Option type="4"/>
|
||||
<MakeCommands>
|
||||
<Build command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 all"/>
|
||||
<CompileFile command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 "$file""/>
|
||||
<Clean command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 clean"/>
|
||||
<DistClean command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 clean"/>
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
<Target title="ninja">
|
||||
<Option output="C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/ninja.exe" prefix_auto="0" extension_auto="0"/>
|
||||
<Option working_dir="C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug"/>
|
||||
<Option object_output="./"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="gcc"/>
|
||||
<Compiler>
|
||||
<Add directory="C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug"/>
|
||||
<Add directory="C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include"/>
|
||||
<Add directory="C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include"/>
|
||||
<Add directory="C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed"/>
|
||||
<Add directory="C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/include"/>
|
||||
</Compiler>
|
||||
<MakeCommands>
|
||||
<Build command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 ninja"/>
|
||||
<CompileFile command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 "$file""/>
|
||||
<Clean command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 clean"/>
|
||||
<DistClean command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 clean"/>
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
<Target title="ninja/fast">
|
||||
<Option output="C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/ninja.exe" prefix_auto="0" extension_auto="0"/>
|
||||
<Option working_dir="C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug"/>
|
||||
<Option object_output="./"/>
|
||||
<Option type="1"/>
|
||||
<Option compiler="gcc"/>
|
||||
<Compiler>
|
||||
<Add directory="C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug"/>
|
||||
<Add directory="C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include"/>
|
||||
<Add directory="C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../include"/>
|
||||
<Add directory="C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/include-fixed"/>
|
||||
<Add directory="C:/Program Files (x86)/JetBrains/CLion 2023.1.5/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/include"/>
|
||||
</Compiler>
|
||||
<MakeCommands>
|
||||
<Build command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 ninja/fast"/>
|
||||
<CompileFile command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 "$file""/>
|
||||
<Clean command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 clean"/>
|
||||
<DistClean command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 clean"/>
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
<Target title="edit_cache">
|
||||
<Option working_dir="C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug"/>
|
||||
<Option type="4"/>
|
||||
<MakeCommands>
|
||||
<Build command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 edit_cache"/>
|
||||
<CompileFile command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 "$file""/>
|
||||
<Clean command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 clean"/>
|
||||
<DistClean command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 clean"/>
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
<Target title="rebuild_cache">
|
||||
<Option working_dir="C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug"/>
|
||||
<Option type="4"/>
|
||||
<MakeCommands>
|
||||
<Build command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 rebuild_cache"/>
|
||||
<CompileFile command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 "$file""/>
|
||||
<Clean command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 clean"/>
|
||||
<DistClean command="C:/PROGRA~2/JETBRA~1/CLION2~1.5/bin/mingw/bin/mingw32-make.exe -f "C:/Users/Nilss/CLionProjects/ninja/cmake-build-debug/Makefile" VERBOSE=1 clean"/>
|
||||
</MakeCommands>
|
||||
</Target>
|
||||
</Build>
|
||||
<Unit filename="C:/Users/Nilss/CLionProjects/ninja/config.h.in">
|
||||
<Option target="ninja"/>
|
||||
</Unit>
|
||||
<Unit filename="C:/Users/Nilss/CLionProjects/ninja/njvm.c">
|
||||
<Option target="ninja"/>
|
||||
</Unit>
|
||||
<Unit filename="C:/Users/Nilss/CLionProjects/ninja/CMakeLists.txt">
|
||||
<Option virtualFolder="CMake Files\"/>
|
||||
</Unit>
|
||||
<Unit filename="C:/Users/Nilss/CLionProjects/ninja/config.h.in">
|
||||
<Option virtualFolder="CMake Files\"/>
|
||||
</Unit>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
||||
Binary file not shown.
38
code.c
Normal file
38
code.c
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef CODE
|
||||
|
||||
#define CODE
|
||||
|
||||
#include "instruktion.c"
|
||||
|
||||
unsigned int code1[] = {
|
||||
(PUSHC << 24) | IMMEDIATE(3),
|
||||
(PUSHC << 24) | IMMEDIATE(4),
|
||||
(ADD << 24),
|
||||
(PUSHC << 24) | IMMEDIATE(10),
|
||||
(PUSHC << 24) | IMMEDIATE(6),
|
||||
(SUB << 24),
|
||||
(MUL << 24),
|
||||
(WRINT << 24),
|
||||
(PUSHC << 24) | IMMEDIATE(10),
|
||||
(WRCHR << 24),
|
||||
(HALT)
|
||||
};
|
||||
unsigned int code2[] = {
|
||||
(PUSHC << 24) | IMMEDIATE(SIGN_EXTEND(-2)),
|
||||
(RDINT << 24),
|
||||
(MUL << 24),
|
||||
(PUSHC << 24) | IMMEDIATE(3),
|
||||
(ADD << 24),
|
||||
(WRINT << 24),
|
||||
(PUSHC << 24) | IMMEDIATE('\n'),
|
||||
(WRCHR << 24),
|
||||
(HALT << 24)
|
||||
};
|
||||
unsigned int code3[] = {
|
||||
(RDCHR << 24),
|
||||
(WRINT << 24),
|
||||
(PUSHC << 24) | IMMEDIATE('\n'),
|
||||
(WRCHR << 24),
|
||||
(HALT << 24)
|
||||
};
|
||||
#endif
|
||||
37
codeReader.c
Normal file
37
codeReader.c
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef CODEREADER
|
||||
#define CODEREADER
|
||||
|
||||
#include "consts.c"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "program.c"
|
||||
|
||||
unsigned int fromFile(char *path, struct program program) {
|
||||
unsigned int countInstructions;
|
||||
unsigned int staticVars;
|
||||
FILE *fptr;
|
||||
fptr = fopen(path, "r");
|
||||
if (fptr == NULL) {
|
||||
printf("Error: cannot open code file %s", path);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
unsigned int buffer[4];
|
||||
fread(buffer, 4, 4, fptr);
|
||||
// Check file type
|
||||
if (buffer[0] != 0x46424A4E) {
|
||||
printf("Error: wrong file type");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (buffer[1] != VERSION) {
|
||||
printf("Error: wrong version");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
countInstructions = buffer[2];
|
||||
staticVars = buffer[3];
|
||||
unsigned int instBuffer[countInstructions];
|
||||
fread(instBuffer, 4, countInstructions, fptr);
|
||||
copyToProgram(instBuffer, countInstructions, program);
|
||||
return staticVars;
|
||||
}
|
||||
|
||||
#endif /* ifdef CODEREADER */
|
||||
3
compile_flags.txt
Normal file
3
compile_flags.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
-Ibigint/build/include
|
||||
-Lbigint/build/lib
|
||||
-lbigint
|
||||
@@ -1 +0,0 @@
|
||||
#define PROJECT_VERSION @PROJECT_VERSION@
|
||||
7
consts.c
Normal file
7
consts.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#ifndef CONSTS
|
||||
#define CONSTS
|
||||
#define VERSION 8
|
||||
|
||||
#endif /* ifndef CONSTS
|
||||
#define CONSTS
|
||||
#define VERSION 2; */
|
||||
55
debugMenu.c
Normal file
55
debugMenu.c
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef DEBUGMENU
|
||||
#define DEBUGMENU
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "stack.c"
|
||||
#include "stack.c"
|
||||
|
||||
void inspect(struct stack s, int fp){
|
||||
//todo Does not work dont know why
|
||||
char input[20];
|
||||
char ref[20];
|
||||
char refStr[20];
|
||||
printf("DEBUG [inspect]: stack, datam object?");
|
||||
fgets(input,20,stdin);
|
||||
if (input[0] == 's') printStack(s, fp);
|
||||
if (input[0] == 'd'){/* todo */ }
|
||||
if (input[0] == 'o'){
|
||||
scanf("%19s",ref);
|
||||
ObjRefContainer container;
|
||||
for (int i = 0; i<= container.size; i++) {
|
||||
sprintf(refStr, "%p", (void *)&container.refs[i]);
|
||||
if(strcmp(ref, refStr) == 0) printf("Adress exists\n");
|
||||
else printf("Adress doeas not exist\n");
|
||||
printf("%s",refStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
void list(void){
|
||||
//todo
|
||||
}
|
||||
void breakpoint(int *bp){
|
||||
printf("BREAKPOINT: ");
|
||||
char input[20];
|
||||
fgets(input,20,stdin);
|
||||
*bp = atoi(input);
|
||||
}
|
||||
|
||||
void debugMenu(int fp, struct stack stack, int* debug, int point, int* bp){
|
||||
char input[20];
|
||||
while (true) {
|
||||
printf("DEBUG(%i): inspect, list, breakpoint, run, step, quit?",point);
|
||||
fgets(input, 20, stdin);
|
||||
printf("%s",input);
|
||||
if(input[0] == 'i') {inspect(stack,fp);}
|
||||
if(input[0] == 'l') list();
|
||||
if(input[0] == 'b') breakpoint(bp);
|
||||
if(input[0] == 's') break;
|
||||
if(input[0] == 'r') {*debug = 0; break;};
|
||||
if(input[0] == 'q') exit(0);
|
||||
strcpy(input, "");
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ifndef DEBUGMENU */
|
||||
8301
factor.asm
Normal file
8301
factor.asm
Normal file
File diff suppressed because it is too large
Load Diff
BIN
factor.bin
Normal file
BIN
factor.bin
Normal file
Binary file not shown.
794
factor.nj
Normal file
794
factor.nj
Normal file
@@ -0,0 +1,794 @@
|
||||
//
|
||||
// factor.nj -- factorize the numbers 10^n+1, n = 1..30
|
||||
//
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// handle list of factors
|
||||
|
||||
type List = record {
|
||||
Integer value;
|
||||
List next;
|
||||
};
|
||||
|
||||
List addToList(Integer value, List next) {
|
||||
local List newList;
|
||||
newList = new(List);
|
||||
newList.value = value;
|
||||
newList.next = next;
|
||||
return newList;
|
||||
}
|
||||
|
||||
List sortList(List list) {
|
||||
local List result;
|
||||
local List element;
|
||||
local List p;
|
||||
result = nil;
|
||||
while (list != nil) {
|
||||
element = list;
|
||||
list = list.next;
|
||||
if (result == nil || element.value < result.value) {
|
||||
element.next = result;
|
||||
result = element;
|
||||
} else {
|
||||
p = result;
|
||||
while (p.next != nil && element.value >= p.next.value) {
|
||||
p = p.next;
|
||||
}
|
||||
element.next = p.next;
|
||||
p.next = element;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void showList(List list) {
|
||||
if (list == nil) {
|
||||
writeString("1");
|
||||
} else {
|
||||
while (true) {
|
||||
writeInteger(list.value);
|
||||
list = list.next;
|
||||
if (list == nil) {
|
||||
break;
|
||||
}
|
||||
writeString(" * ");
|
||||
}
|
||||
}
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
Integer evalList(List list) {
|
||||
local Integer result;
|
||||
result = 1;
|
||||
while (list != nil) {
|
||||
result = result * list.value;
|
||||
list = list.next;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
List fuseLists(List list1, List list2) {
|
||||
local List element;
|
||||
while (list1 != nil) {
|
||||
element = list1;
|
||||
list1 = list1.next;
|
||||
element.next = list2;
|
||||
list2 = element;
|
||||
}
|
||||
return list2;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// compute 10^n+1
|
||||
|
||||
Integer computeTarget(Integer n) {
|
||||
local Integer x;
|
||||
local Integer i;
|
||||
x = 1;
|
||||
i = 0;
|
||||
while (i < n) {
|
||||
x = x * 10;
|
||||
i = i + 1;
|
||||
}
|
||||
x = x + 1;
|
||||
return x;
|
||||
}
|
||||
|
||||
void testComputeTarget() {
|
||||
writeString("computeTarget()\n");
|
||||
writeString("---------------\n");
|
||||
writeString("target(1) = ");
|
||||
writeInteger(computeTarget(1));
|
||||
writeString("\n");
|
||||
writeString("target(2) = ");
|
||||
writeInteger(computeTarget(2));
|
||||
writeString("\n");
|
||||
writeString("target(3) = ");
|
||||
writeInteger(computeTarget(3));
|
||||
writeString("\n");
|
||||
writeString("target(4) = ");
|
||||
writeInteger(computeTarget(4));
|
||||
writeString("\n");
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// build a table of small primes
|
||||
|
||||
global Integer smallPrimesLimit;
|
||||
|
||||
global Integer[] primes;
|
||||
global Integer numPrimes;
|
||||
|
||||
void showSmallPrimes() {
|
||||
local Integer i;
|
||||
local Integer k;
|
||||
i = 0;
|
||||
k = 0;
|
||||
while (i < numPrimes) {
|
||||
writeInteger(primes[i]);
|
||||
writeString(" ");
|
||||
k = k + 1;
|
||||
if (k == 8) {
|
||||
k = 0;
|
||||
writeString("\n");
|
||||
}
|
||||
i = i + 1;
|
||||
}
|
||||
if (k != 0) {
|
||||
writeString("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void enterSmallPrime(Integer p) {
|
||||
local Integer n;
|
||||
local Integer[] a;
|
||||
local Integer i;
|
||||
if (sizeof(primes) == numPrimes) {
|
||||
n = 2 * numPrimes;
|
||||
a = new(Integer[n]);
|
||||
i = 0;
|
||||
while (i < numPrimes) {
|
||||
a[i] = primes[i];
|
||||
i = i + 1;
|
||||
}
|
||||
primes = a;
|
||||
}
|
||||
primes[numPrimes] = p;
|
||||
numPrimes = numPrimes + 1;
|
||||
}
|
||||
|
||||
Boolean isPrime(Integer n) {
|
||||
local Integer t;
|
||||
t = 3;
|
||||
while (t * t <= n) {
|
||||
if (n % t == 0) {
|
||||
return false;
|
||||
}
|
||||
t = t + 2;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void calcSmallPrimes(Integer limit) {
|
||||
local Integer i;
|
||||
smallPrimesLimit = limit;
|
||||
primes = new(Integer[256]);
|
||||
numPrimes = 0;
|
||||
enterSmallPrime(2);
|
||||
enterSmallPrime(3);
|
||||
i = 5;
|
||||
while (true) {
|
||||
if (i > smallPrimesLimit) {
|
||||
break;
|
||||
}
|
||||
if (isPrime(i)) {
|
||||
enterSmallPrime(i);
|
||||
}
|
||||
i = i + 2;
|
||||
if (i > smallPrimesLimit) {
|
||||
break;
|
||||
}
|
||||
if (isPrime(i)) {
|
||||
enterSmallPrime(i);
|
||||
}
|
||||
i = i + 4;
|
||||
}
|
||||
}
|
||||
|
||||
void testCalcSmallPrimes() {
|
||||
writeString("calcSmallPrimes()\n");
|
||||
writeString("-----------------\n");
|
||||
writeString("primes less than or equal to 100:\n");
|
||||
calcSmallPrimes(100);
|
||||
showSmallPrimes();
|
||||
writeString("number of primes less than or equal to 100: ");
|
||||
writeInteger(numPrimes);
|
||||
writeString("\n");
|
||||
calcSmallPrimes(1000);
|
||||
writeString("number of primes less than or equal to 1000: ");
|
||||
writeInteger(numPrimes);
|
||||
writeString("\n");
|
||||
calcSmallPrimes(10000);
|
||||
writeString("number of primes less than or equal to 10000: ");
|
||||
writeInteger(numPrimes);
|
||||
writeString("\n");
|
||||
calcSmallPrimes(100000);
|
||||
writeString("number of primes less than or equal to 100000: ");
|
||||
writeInteger(numPrimes);
|
||||
writeString("\n");
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// try to find a small prime factor of a given number
|
||||
|
||||
Integer smallPrimeFactor(Integer n) {
|
||||
local Integer i;
|
||||
i = 0;
|
||||
while (i < numPrimes) {
|
||||
if (n % primes[i] == 0) {
|
||||
// prime factor found
|
||||
return primes[i];
|
||||
}
|
||||
i = i + 1;
|
||||
}
|
||||
// no prime factor less than or equal to smallPrimesLimit found
|
||||
return 0;
|
||||
}
|
||||
|
||||
void testSmallPrimeFactor() {
|
||||
calcSmallPrimes(10000);
|
||||
writeString("smallPrimeFactor()\n");
|
||||
writeString("------------------\n");
|
||||
writeString("small prime factor of 2: ");
|
||||
writeInteger(smallPrimeFactor(2));
|
||||
writeString("\n");
|
||||
writeString("small prime factor of 222: ");
|
||||
writeInteger(smallPrimeFactor(222));
|
||||
writeString("\n");
|
||||
writeString("small prime factor of 17*19*23: ");
|
||||
writeInteger(smallPrimeFactor(17*19*23));
|
||||
writeString("\n");
|
||||
writeString("small prime factor of 7919: ");
|
||||
writeInteger(smallPrimeFactor(7919));
|
||||
writeString("\n");
|
||||
writeString("small prime factor of 987654323: ");
|
||||
writeInteger(smallPrimeFactor(987654323));
|
||||
writeString("\n");
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// compute b^n mod m
|
||||
|
||||
Integer powerMod(Integer b, Integer n, Integer m) {
|
||||
local Integer a;
|
||||
a = 1;
|
||||
while (n != 0) {
|
||||
if (n % 2 == 0) {
|
||||
b = (b * b) % m;
|
||||
n = n / 2;
|
||||
} else {
|
||||
a = (a * b) % m;
|
||||
n = n - 1;
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
void testPowerMod() {
|
||||
writeString("powerMod()\n");
|
||||
writeString("----------\n");
|
||||
writeString("2^16 mod 7: ");
|
||||
writeInteger(powerMod(2, 16, 7));
|
||||
writeString("\n");
|
||||
writeString("3^10 mod 19: ");
|
||||
writeInteger(powerMod(3, 10, 19));
|
||||
writeString("\n");
|
||||
writeString("123^987654323 mod 987654323: ");
|
||||
writeInteger(powerMod(123, 987654323, 987654323));
|
||||
writeString("\n");
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// compute greatest common divisor
|
||||
|
||||
Integer GCD(Integer a, Integer b) {
|
||||
local Integer r;
|
||||
if (a < 0) {
|
||||
a = -a;
|
||||
}
|
||||
if (b < 0) {
|
||||
b = -b;
|
||||
}
|
||||
while (b != 0) {
|
||||
r = a % b;
|
||||
a = b;
|
||||
b = r;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
void testGCD() {
|
||||
writeString("GCD()\n");
|
||||
writeString("-----\n");
|
||||
writeString("GCD(3*5*5*11*37, 2*2*5*37*53) = ");
|
||||
writeInteger(GCD(3*5*5*11*37, 2*2*5*37*53));
|
||||
writeString("\n");
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// Rabin-Miller test
|
||||
|
||||
Boolean isComposite(Integer n) {
|
||||
local Integer q;
|
||||
local Integer t;
|
||||
local Integer i;
|
||||
local Integer a;
|
||||
local Integer e;
|
||||
local Integer b;
|
||||
q = n - 1;
|
||||
t = 0;
|
||||
while (q % 2 == 0) {
|
||||
q = q / 2;
|
||||
t = t + 1;
|
||||
}
|
||||
i = 0;
|
||||
while (i < 20) {
|
||||
a = primes[i];
|
||||
if (a >= n) {
|
||||
break;
|
||||
}
|
||||
e = 0;
|
||||
b = powerMod(a, q, n);
|
||||
if (b != 1) {
|
||||
while (b != 1 && b != n - 1 && e <= t - 2) {
|
||||
b = (b * b) % n;
|
||||
e = e + 1;
|
||||
}
|
||||
if (b != n - 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
i = i + 1;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void testIsComposite() {
|
||||
local Integer n;
|
||||
local Integer k;
|
||||
writeString("isComposite()\n");
|
||||
writeString("-------------\n");
|
||||
writeString("odd numbers in [3..99] which are probably prime:\n");
|
||||
n = 3;
|
||||
k = 0;
|
||||
while (n < 100) {
|
||||
if (!isComposite(n)) {
|
||||
writeInteger(n);
|
||||
writeString(" ");
|
||||
k = k + 1;
|
||||
if (k == 8) {
|
||||
k = 0;
|
||||
writeString("\n");
|
||||
}
|
||||
}
|
||||
n = n + 2;
|
||||
}
|
||||
if (k != 0) {
|
||||
writeString("\n");
|
||||
}
|
||||
n = 1234567;
|
||||
while (n < 1234607) {
|
||||
writeInteger(n);
|
||||
writeString(" is ");
|
||||
if (isComposite(n)) {
|
||||
writeString("definitely composite\n");
|
||||
} else {
|
||||
writeString("probably prime\n");
|
||||
}
|
||||
n = n + 2;
|
||||
}
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
Boolean provePrime(Integer n) {
|
||||
// not implemented yet
|
||||
return false;
|
||||
}
|
||||
|
||||
void testProvePrime() {
|
||||
writeString("provePrime()\n");
|
||||
writeString("------------\n");
|
||||
writeString("<not implemented yet>\n");
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// Pollard's rho method
|
||||
|
||||
Integer findFactor1(Integer n) {
|
||||
local Integer y;
|
||||
local Integer x;
|
||||
local Integer x1;
|
||||
local Integer k;
|
||||
local Integer l;
|
||||
local Integer p;
|
||||
local Integer c;
|
||||
local Integer g;
|
||||
local Integer r;
|
||||
y = 2;
|
||||
x = 2;
|
||||
x1 = 2;
|
||||
k = 1;
|
||||
l = 1;
|
||||
p = 1;
|
||||
c = 0;
|
||||
while (true) {
|
||||
x = (x * x + 1) % n;
|
||||
p = (p * (x1 - x)) % n;
|
||||
c = c + 1;
|
||||
if (c == 20) {
|
||||
g = GCD(p, n);
|
||||
if (g > 1) {
|
||||
break;
|
||||
}
|
||||
y = x;
|
||||
c = 0;
|
||||
}
|
||||
k = k - 1;
|
||||
if (k == 0) {
|
||||
g = GCD(p, n);
|
||||
if (g > 1) {
|
||||
break;
|
||||
}
|
||||
x1 = x;
|
||||
k = l;
|
||||
l = 2 * l;
|
||||
r = 0;
|
||||
while (r < k) {
|
||||
x = (x * x + 1) % n;
|
||||
r = r + 1;
|
||||
}
|
||||
y = x;
|
||||
c = 0;
|
||||
}
|
||||
}
|
||||
do {
|
||||
y = (y * y + 1) % n;
|
||||
g = GCD(x1 - y, n);
|
||||
} while (g == 1);
|
||||
if (g < n) {
|
||||
return g;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Integer findFactor2(Integer n) {
|
||||
local Integer y;
|
||||
local Integer x;
|
||||
local Integer x1;
|
||||
local Integer k;
|
||||
local Integer l;
|
||||
local Integer p;
|
||||
local Integer c;
|
||||
local Integer g;
|
||||
local Integer r;
|
||||
y = 2;
|
||||
x = 2;
|
||||
x1 = 2;
|
||||
k = 1;
|
||||
l = 1;
|
||||
p = 1;
|
||||
c = 0;
|
||||
while (true) {
|
||||
x = (x * x - 1) % n;
|
||||
p = (p * (x1 - x)) % n;
|
||||
c = c + 1;
|
||||
if (c == 20) {
|
||||
g = GCD(p, n);
|
||||
if (g > 1) {
|
||||
break;
|
||||
}
|
||||
y = x;
|
||||
c = 0;
|
||||
}
|
||||
k = k - 1;
|
||||
if (k == 0) {
|
||||
g = GCD(p, n);
|
||||
if (g > 1) {
|
||||
break;
|
||||
}
|
||||
x1 = x;
|
||||
k = l;
|
||||
l = 2 * l;
|
||||
r = 0;
|
||||
while (r < k) {
|
||||
x = (x * x - 1) % n;
|
||||
r = r + 1;
|
||||
}
|
||||
y = x;
|
||||
c = 0;
|
||||
}
|
||||
}
|
||||
do {
|
||||
y = (y * y - 1) % n;
|
||||
g = GCD(x1 - y, n);
|
||||
} while (g == 1);
|
||||
if (g < n) {
|
||||
return g;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Integer findFactor3(Integer n) {
|
||||
local Integer y;
|
||||
local Integer x;
|
||||
local Integer x1;
|
||||
local Integer k;
|
||||
local Integer l;
|
||||
local Integer p;
|
||||
local Integer c;
|
||||
local Integer g;
|
||||
local Integer r;
|
||||
y = 2;
|
||||
x = 2;
|
||||
x1 = 2;
|
||||
k = 1;
|
||||
l = 1;
|
||||
p = 1;
|
||||
c = 0;
|
||||
while (true) {
|
||||
x = (x * x + 3) % n;
|
||||
p = (p * (x1 - x)) % n;
|
||||
c = c + 1;
|
||||
if (c == 20) {
|
||||
g = GCD(p, n);
|
||||
if (g > 1) {
|
||||
break;
|
||||
}
|
||||
y = x;
|
||||
c = 0;
|
||||
}
|
||||
k = k - 1;
|
||||
if (k == 0) {
|
||||
g = GCD(p, n);
|
||||
if (g > 1) {
|
||||
break;
|
||||
}
|
||||
x1 = x;
|
||||
k = l;
|
||||
l = 2 * l;
|
||||
r = 0;
|
||||
while (r < k) {
|
||||
x = (x * x + 3) % n;
|
||||
r = r + 1;
|
||||
}
|
||||
y = x;
|
||||
c = 0;
|
||||
}
|
||||
}
|
||||
do {
|
||||
y = (y * y + 3) % n;
|
||||
g = GCD(x1 - y, n);
|
||||
} while (g == 1);
|
||||
if (g < n) {
|
||||
return g;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Integer findFactor(Integer n) {
|
||||
local Integer r;
|
||||
r = findFactor1(n);
|
||||
if (r != 0) {
|
||||
return r;
|
||||
}
|
||||
r = findFactor2(n);
|
||||
if (r != 0) {
|
||||
return r;
|
||||
}
|
||||
r = findFactor3(n);
|
||||
return r;
|
||||
}
|
||||
|
||||
void testFindFactor() {
|
||||
writeString("findFactor()\n");
|
||||
writeString("------------\n");
|
||||
writeString("5*5*5 = ");
|
||||
writeInteger(5*5*5);
|
||||
writeString(" is a multiple of ");
|
||||
writeInteger(findFactor(5*5*5));
|
||||
writeString("\n");
|
||||
writeString("4421*5743*7699 = ");
|
||||
writeInteger(4421*5743*7699);
|
||||
writeString(" is a multiple of ");
|
||||
writeInteger(findFactor(4421*5743*7699));
|
||||
writeString("\n");
|
||||
writeInteger(9999000099990001);
|
||||
writeString(" is a multiple of ");
|
||||
writeInteger(findFactor(9999000099990001));
|
||||
writeString("\n");
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
List factorize(Integer x, Boolean verbose) {
|
||||
local List factors;
|
||||
local Integer f;
|
||||
local Integer f1;
|
||||
local Integer f2;
|
||||
local List moreFactors;
|
||||
if (verbose) {
|
||||
writeString("factorize(");
|
||||
writeInteger(x);
|
||||
writeString(")\n");
|
||||
}
|
||||
factors = nil;
|
||||
while (x > 1) {
|
||||
f = smallPrimeFactor(x);
|
||||
if (f == 0) {
|
||||
// no small prime factor found
|
||||
if (x < smallPrimesLimit * smallPrimesLimit) {
|
||||
// we know that x is prime
|
||||
f = x;
|
||||
} else {
|
||||
// we don't know anything
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (verbose) {
|
||||
writeString("detected small prime factor ");
|
||||
writeInteger(f);
|
||||
writeString("\n");
|
||||
}
|
||||
factors = addToList(f, factors);
|
||||
x = x / f;
|
||||
}
|
||||
if (x == 1) {
|
||||
// x has been completely factorized
|
||||
if (verbose) {
|
||||
writeString("the number has been completely factorized\n");
|
||||
}
|
||||
return factors;
|
||||
}
|
||||
if (verbose) {
|
||||
writeString("interim result:\n the remaining factor ");
|
||||
writeInteger(x);
|
||||
writeString("\n doesn't have any prime factors < ");
|
||||
writeInteger(smallPrimesLimit);
|
||||
writeString("\n ");
|
||||
}
|
||||
if (isComposite(x)) {
|
||||
// x is definitely composite
|
||||
if (verbose) {
|
||||
writeString("but is definitely composite\n");
|
||||
}
|
||||
f1 = findFactor(x);
|
||||
if (f1 == 0) {
|
||||
// cannot factorize x, give up
|
||||
writeString("cannot factorize ");
|
||||
writeInteger(x);
|
||||
writeString(", giving up\n");
|
||||
factors = addToList(x, factors);
|
||||
} else {
|
||||
// x = f1 * f2
|
||||
f2 = x / f1;
|
||||
if (verbose) {
|
||||
writeString("this number can be split into ");
|
||||
writeInteger(f1);
|
||||
writeString(" and ");
|
||||
writeInteger(f2);
|
||||
writeString("\n");
|
||||
}
|
||||
moreFactors = factorize(f1, verbose);
|
||||
factors = fuseLists(moreFactors, factors);
|
||||
moreFactors = factorize(f2, verbose);
|
||||
factors = fuseLists(moreFactors, factors);
|
||||
}
|
||||
} else {
|
||||
// x is very probably prime
|
||||
if (verbose) {
|
||||
writeString("and is very probably prime\n");
|
||||
}
|
||||
if (provePrime(x)) {
|
||||
if (verbose) {
|
||||
writeString("the primality of ");
|
||||
writeInteger(x);
|
||||
writeString(" has been proven\n");
|
||||
}
|
||||
} else {
|
||||
writeString("cannot prove the primality of ");
|
||||
writeInteger(x);
|
||||
writeString(", giving up\n");
|
||||
}
|
||||
factors = addToList(x, factors);
|
||||
}
|
||||
return factors;
|
||||
}
|
||||
|
||||
void testFactorize(Boolean verbose) {
|
||||
local List factors;
|
||||
writeString("factorize()\n");
|
||||
writeString("-----------\n");
|
||||
calcSmallPrimes(7);
|
||||
showSmallPrimes();
|
||||
writeString("3*5*7*7*141*49 = \n");
|
||||
factors = factorize(3*5*7*7*141*49, verbose);
|
||||
showList(sortList(factors));
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
void showBar() {
|
||||
writeString("---------------------------------");
|
||||
writeString("-------------------------------\n");
|
||||
}
|
||||
|
||||
void run(Boolean verbose) {
|
||||
local Integer i;
|
||||
local Integer x;
|
||||
local List factors;
|
||||
local Integer y;
|
||||
calcSmallPrimes(10000);
|
||||
showBar();
|
||||
i = 1;
|
||||
while (i <= 30) {
|
||||
writeString("10^");
|
||||
writeInteger(i);
|
||||
writeString("+1 = ");
|
||||
x = computeTarget(i);
|
||||
writeInteger(x);
|
||||
writeString(" = \n");
|
||||
factors = factorize(x, verbose);
|
||||
factors = sortList(factors);
|
||||
showList(factors);
|
||||
writeString("check: product = ");
|
||||
y = evalList(factors);
|
||||
writeInteger(y);
|
||||
writeString("\n");
|
||||
showBar();
|
||||
i = i+ 1;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
void tests(Boolean verbose) {
|
||||
writeString("\nTests\n");
|
||||
writeString("=====\n\n");
|
||||
testComputeTarget();
|
||||
testCalcSmallPrimes();
|
||||
testSmallPrimeFactor();
|
||||
testPowerMod();
|
||||
testGCD();
|
||||
testIsComposite();
|
||||
testProvePrime();
|
||||
testFindFactor();
|
||||
testFactorize(verbose);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
void main() {
|
||||
//tests(true);
|
||||
run(true);
|
||||
}
|
||||
54
instruktion.c
Normal file
54
instruktion.c
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef INSREUKTION
|
||||
#define INSREUKTION
|
||||
|
||||
#define IMMEDIATE(x) ((x) & 0x00FFFFFF)
|
||||
#define MSB (1 << (8 * sizeof(unsigned int) - 1))
|
||||
#define IS_PRIMITIVE(objRef) (((objRef)->size & MSB) == 0)
|
||||
#define SIGN_EXTEND(i) ((i) & 0x00800000 ? (i) | 0xFF000000 : (i))
|
||||
#define GET_ELEMENT_COUNT(objRef) ((objRef)->size & ~MSB)
|
||||
#define GET_REFS_PTR(objRef) ((ObjRef *) (objRef)-> data)
|
||||
|
||||
#define HALT 0
|
||||
#define PUSHC 1
|
||||
#define ADD 2
|
||||
#define SUB 3
|
||||
#define MUL 4
|
||||
#define DIV 5
|
||||
#define MOD 6
|
||||
#define RDINT 7
|
||||
#define WRINT 8
|
||||
#define RDCHR 9
|
||||
#define WRCHR 10
|
||||
#define PUSHG 11
|
||||
#define POPG 12
|
||||
#define ASF 13
|
||||
#define RSF 14
|
||||
#define PUSHL 15
|
||||
#define POPL 16
|
||||
#define EQ 17
|
||||
#define NE 18
|
||||
#define LT 19
|
||||
#define LE 20
|
||||
#define GT 21
|
||||
#define GE 22
|
||||
#define JMP 23
|
||||
#define BRF 24
|
||||
#define BRT 25
|
||||
#define CALL 26
|
||||
#define RET 27
|
||||
#define DROP 28
|
||||
#define PUSHR 29
|
||||
#define POPR 30
|
||||
#define DUP 31
|
||||
#define NEW 32
|
||||
#define GETF 33
|
||||
#define PUTF 34
|
||||
#define NEWA 35
|
||||
#define GETFA 36
|
||||
#define PUTFA 37
|
||||
#define GETSZ 38
|
||||
#define PUSHN 39
|
||||
#define REFEQ 40
|
||||
#define REFNE 41
|
||||
|
||||
#endif /* ifndef INSREUKTION */
|
||||
778
matinv.asm
Normal file
778
matinv.asm
Normal file
@@ -0,0 +1,778 @@
|
||||
//
|
||||
// version
|
||||
//
|
||||
.vers 8
|
||||
|
||||
//
|
||||
// execution framework
|
||||
//
|
||||
__start:
|
||||
call _main
|
||||
call _exit
|
||||
__stop:
|
||||
jmp __stop
|
||||
|
||||
//
|
||||
// Integer readInteger()
|
||||
//
|
||||
_readInteger:
|
||||
asf 0
|
||||
rdint
|
||||
popr
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void writeInteger(Integer)
|
||||
//
|
||||
_writeInteger:
|
||||
asf 0
|
||||
pushl -3
|
||||
wrint
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Character readCharacter()
|
||||
//
|
||||
_readCharacter:
|
||||
asf 0
|
||||
rdchr
|
||||
popr
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void writeCharacter(Character)
|
||||
//
|
||||
_writeCharacter:
|
||||
asf 0
|
||||
pushl -3
|
||||
wrchr
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Integer char2int(Character)
|
||||
//
|
||||
_char2int:
|
||||
asf 0
|
||||
pushl -3
|
||||
popr
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Character int2char(Integer)
|
||||
//
|
||||
_int2char:
|
||||
asf 0
|
||||
pushl -3
|
||||
popr
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void exit()
|
||||
//
|
||||
_exit:
|
||||
asf 0
|
||||
halt
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void writeString(String)
|
||||
//
|
||||
_writeString:
|
||||
asf 1
|
||||
pushc 0
|
||||
popl 0
|
||||
jmp _writeString_L2
|
||||
_writeString_L1:
|
||||
pushl -3
|
||||
pushl 0
|
||||
getfa
|
||||
call _writeCharacter
|
||||
drop 1
|
||||
pushl 0
|
||||
pushc 1
|
||||
add
|
||||
popl 0
|
||||
_writeString_L2:
|
||||
pushl 0
|
||||
pushl -3
|
||||
getsz
|
||||
lt
|
||||
brt _writeString_L1
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Integer gcd(Integer, Integer)
|
||||
//
|
||||
_gcd:
|
||||
asf 1
|
||||
jmp __2
|
||||
__1:
|
||||
pushl -4
|
||||
pushl -3
|
||||
mod
|
||||
popl 0
|
||||
pushl -3
|
||||
popl -4
|
||||
pushl 0
|
||||
popl -3
|
||||
__2:
|
||||
pushl -3
|
||||
pushc 0
|
||||
ne
|
||||
brt __1
|
||||
__3:
|
||||
pushl -4
|
||||
popr
|
||||
jmp __0
|
||||
__0:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } newFraction(Integer, Integer)
|
||||
//
|
||||
_newFraction:
|
||||
asf 4
|
||||
pushl -4
|
||||
pushc 0
|
||||
lt
|
||||
brf __5
|
||||
pushc 0
|
||||
pushl -4
|
||||
sub
|
||||
popl 0
|
||||
jmp __6
|
||||
__5:
|
||||
pushl -4
|
||||
popl 0
|
||||
__6:
|
||||
pushl -3
|
||||
pushc 0
|
||||
lt
|
||||
brf __7
|
||||
pushc 0
|
||||
pushl -3
|
||||
sub
|
||||
popl 1
|
||||
jmp __8
|
||||
__7:
|
||||
pushl -3
|
||||
popl 1
|
||||
__8:
|
||||
pushl 0
|
||||
pushl 1
|
||||
call _gcd
|
||||
drop 2
|
||||
pushr
|
||||
popl 2
|
||||
new 2
|
||||
popl 3
|
||||
pushl -4
|
||||
pushc 0
|
||||
lt
|
||||
pushl -3
|
||||
pushc 0
|
||||
lt
|
||||
ne
|
||||
brf __9
|
||||
pushl 3
|
||||
pushc 0
|
||||
pushl 0
|
||||
sub
|
||||
pushl 2
|
||||
div
|
||||
putf 0
|
||||
jmp __10
|
||||
__9:
|
||||
pushl 3
|
||||
pushl 0
|
||||
pushl 2
|
||||
div
|
||||
putf 0
|
||||
__10:
|
||||
pushl 3
|
||||
pushl 1
|
||||
pushl 2
|
||||
div
|
||||
putf 1
|
||||
pushl 3
|
||||
popr
|
||||
jmp __4
|
||||
__4:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void writeFraction(record { Integer num; Integer den; })
|
||||
//
|
||||
_writeFraction:
|
||||
asf 0
|
||||
pushl -3
|
||||
getf 0
|
||||
call _writeInteger
|
||||
drop 1
|
||||
pushc 1
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 47
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
pushl -3
|
||||
getf 1
|
||||
call _writeInteger
|
||||
drop 1
|
||||
__11:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } negFraction(record { Integer num; Integer den; })
|
||||
//
|
||||
_negFraction:
|
||||
asf 0
|
||||
pushc 0
|
||||
pushl -3
|
||||
getf 0
|
||||
sub
|
||||
pushl -3
|
||||
getf 1
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
popr
|
||||
jmp __12
|
||||
__12:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } addFraction(record { Integer num; Integer den; }, record { Integer num; Integer den; })
|
||||
//
|
||||
_addFraction:
|
||||
asf 0
|
||||
pushl -4
|
||||
getf 0
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
pushl -3
|
||||
getf 0
|
||||
pushl -4
|
||||
getf 1
|
||||
mul
|
||||
add
|
||||
pushl -4
|
||||
getf 1
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
popr
|
||||
jmp __13
|
||||
__13:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } subFraction(record { Integer num; Integer den; }, record { Integer num; Integer den; })
|
||||
//
|
||||
_subFraction:
|
||||
asf 0
|
||||
pushl -4
|
||||
getf 0
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
pushl -3
|
||||
getf 0
|
||||
pushl -4
|
||||
getf 1
|
||||
mul
|
||||
sub
|
||||
pushl -4
|
||||
getf 1
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
popr
|
||||
jmp __14
|
||||
__14:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } mulFraction(record { Integer num; Integer den; }, record { Integer num; Integer den; })
|
||||
//
|
||||
_mulFraction:
|
||||
asf 0
|
||||
pushl -4
|
||||
getf 0
|
||||
pushl -3
|
||||
getf 0
|
||||
mul
|
||||
pushl -4
|
||||
getf 1
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
popr
|
||||
jmp __15
|
||||
__15:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } divFraction(record { Integer num; Integer den; }, record { Integer num; Integer den; })
|
||||
//
|
||||
_divFraction:
|
||||
asf 0
|
||||
pushl -4
|
||||
getf 0
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
pushl -4
|
||||
getf 1
|
||||
pushl -3
|
||||
getf 0
|
||||
mul
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
popr
|
||||
jmp __16
|
||||
__16:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Fraction[][] newMatrix(record { Integer num; Integer den; }, record { Integer num; Integer den; }, record { Integer num; Integer den; }, record { Integer num; Integer den; })
|
||||
//
|
||||
_newMatrix:
|
||||
asf 1
|
||||
pushc 2
|
||||
newa
|
||||
popl 0
|
||||
pushl 0
|
||||
pushc 0
|
||||
pushc 2
|
||||
newa
|
||||
putfa
|
||||
pushl 0
|
||||
pushc 1
|
||||
pushc 2
|
||||
newa
|
||||
putfa
|
||||
pushl 0
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 0
|
||||
pushl -6
|
||||
putfa
|
||||
pushl 0
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 1
|
||||
pushl -5
|
||||
putfa
|
||||
pushl 0
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 0
|
||||
pushl -4
|
||||
putfa
|
||||
pushl 0
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 1
|
||||
pushl -3
|
||||
putfa
|
||||
pushl 0
|
||||
popr
|
||||
jmp __17
|
||||
__17:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void writeMatrix(Fraction[][])
|
||||
//
|
||||
_writeMatrix:
|
||||
asf 2
|
||||
pushc 0
|
||||
popl 0
|
||||
jmp __20
|
||||
__19:
|
||||
pushc 0
|
||||
popl 1
|
||||
jmp __23
|
||||
__22:
|
||||
pushl -3
|
||||
pushl 0
|
||||
getfa
|
||||
pushl 1
|
||||
getfa
|
||||
call _writeFraction
|
||||
drop 1
|
||||
pushc 2
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 32
|
||||
putfa
|
||||
dup
|
||||
pushc 1
|
||||
pushc 32
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
pushl 1
|
||||
pushc 1
|
||||
add
|
||||
popl 1
|
||||
__23:
|
||||
pushl 1
|
||||
pushl -3
|
||||
pushl 0
|
||||
getfa
|
||||
getsz
|
||||
lt
|
||||
brt __22
|
||||
__24:
|
||||
pushc 1
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 10
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
pushl 0
|
||||
pushc 1
|
||||
add
|
||||
popl 0
|
||||
__20:
|
||||
pushl 0
|
||||
pushl -3
|
||||
getsz
|
||||
lt
|
||||
brt __19
|
||||
__21:
|
||||
pushc 1
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 10
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
__18:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Fraction[][] invertMatrix(Fraction[][])
|
||||
//
|
||||
_invertMatrix:
|
||||
asf 1
|
||||
pushl -3
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 0
|
||||
getfa
|
||||
pushl -3
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 1
|
||||
getfa
|
||||
call _mulFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushl -3
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 1
|
||||
getfa
|
||||
pushl -3
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 0
|
||||
getfa
|
||||
call _mulFraction
|
||||
drop 2
|
||||
pushr
|
||||
call _subFraction
|
||||
drop 2
|
||||
pushr
|
||||
popl 0
|
||||
pushl 0
|
||||
getf 0
|
||||
pushc 0
|
||||
eq
|
||||
brf __26
|
||||
pushc 33
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 101
|
||||
putfa
|
||||
dup
|
||||
pushc 1
|
||||
pushc 114
|
||||
putfa
|
||||
dup
|
||||
pushc 2
|
||||
pushc 114
|
||||
putfa
|
||||
dup
|
||||
pushc 3
|
||||
pushc 111
|
||||
putfa
|
||||
dup
|
||||
pushc 4
|
||||
pushc 114
|
||||
putfa
|
||||
dup
|
||||
pushc 5
|
||||
pushc 58
|
||||
putfa
|
||||
dup
|
||||
pushc 6
|
||||
pushc 32
|
||||
putfa
|
||||
dup
|
||||
pushc 7
|
||||
pushc 109
|
||||
putfa
|
||||
dup
|
||||
pushc 8
|
||||
pushc 97
|
||||
putfa
|
||||
dup
|
||||
pushc 9
|
||||
pushc 116
|
||||
putfa
|
||||
dup
|
||||
pushc 10
|
||||
pushc 114
|
||||
putfa
|
||||
dup
|
||||
pushc 11
|
||||
pushc 105
|
||||
putfa
|
||||
dup
|
||||
pushc 12
|
||||
pushc 120
|
||||
putfa
|
||||
dup
|
||||
pushc 13
|
||||
pushc 32
|
||||
putfa
|
||||
dup
|
||||
pushc 14
|
||||
pushc 99
|
||||
putfa
|
||||
dup
|
||||
pushc 15
|
||||
pushc 97
|
||||
putfa
|
||||
dup
|
||||
pushc 16
|
||||
pushc 110
|
||||
putfa
|
||||
dup
|
||||
pushc 17
|
||||
pushc 110
|
||||
putfa
|
||||
dup
|
||||
pushc 18
|
||||
pushc 111
|
||||
putfa
|
||||
dup
|
||||
pushc 19
|
||||
pushc 116
|
||||
putfa
|
||||
dup
|
||||
pushc 20
|
||||
pushc 32
|
||||
putfa
|
||||
dup
|
||||
pushc 21
|
||||
pushc 98
|
||||
putfa
|
||||
dup
|
||||
pushc 22
|
||||
pushc 101
|
||||
putfa
|
||||
dup
|
||||
pushc 23
|
||||
pushc 32
|
||||
putfa
|
||||
dup
|
||||
pushc 24
|
||||
pushc 105
|
||||
putfa
|
||||
dup
|
||||
pushc 25
|
||||
pushc 110
|
||||
putfa
|
||||
dup
|
||||
pushc 26
|
||||
pushc 118
|
||||
putfa
|
||||
dup
|
||||
pushc 27
|
||||
pushc 101
|
||||
putfa
|
||||
dup
|
||||
pushc 28
|
||||
pushc 114
|
||||
putfa
|
||||
dup
|
||||
pushc 29
|
||||
pushc 116
|
||||
putfa
|
||||
dup
|
||||
pushc 30
|
||||
pushc 101
|
||||
putfa
|
||||
dup
|
||||
pushc 31
|
||||
pushc 100
|
||||
putfa
|
||||
dup
|
||||
pushc 32
|
||||
pushc 10
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
call _exit
|
||||
__26:
|
||||
pushl -3
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 1
|
||||
getfa
|
||||
pushl 0
|
||||
call _divFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushl -3
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 1
|
||||
getfa
|
||||
call _negFraction
|
||||
drop 1
|
||||
pushr
|
||||
pushl 0
|
||||
call _divFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushl -3
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 0
|
||||
getfa
|
||||
call _negFraction
|
||||
drop 1
|
||||
pushr
|
||||
pushl 0
|
||||
call _divFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushl -3
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 0
|
||||
getfa
|
||||
pushl 0
|
||||
call _divFraction
|
||||
drop 2
|
||||
pushr
|
||||
call _newMatrix
|
||||
drop 4
|
||||
pushr
|
||||
popr
|
||||
jmp __25
|
||||
__25:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void main()
|
||||
//
|
||||
_main:
|
||||
asf 3
|
||||
pushc 1
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 10
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
pushc 7
|
||||
pushc 1
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushc 4
|
||||
pushc 1
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushc 6
|
||||
pushc 1
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushc 5
|
||||
pushc 1
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
call _newMatrix
|
||||
drop 4
|
||||
pushr
|
||||
popl 0
|
||||
pushl 0
|
||||
call _writeMatrix
|
||||
drop 1
|
||||
pushl 0
|
||||
call _invertMatrix
|
||||
drop 1
|
||||
pushr
|
||||
popl 1
|
||||
pushl 1
|
||||
call _writeMatrix
|
||||
drop 1
|
||||
pushl 1
|
||||
call _invertMatrix
|
||||
drop 1
|
||||
pushr
|
||||
popl 2
|
||||
pushl 2
|
||||
call _writeMatrix
|
||||
drop 1
|
||||
__27:
|
||||
rsf
|
||||
ret
|
||||
BIN
matinv.bin
Normal file
BIN
matinv.bin
Normal file
Binary file not shown.
146
matinv.nj
Normal file
146
matinv.nj
Normal file
@@ -0,0 +1,146 @@
|
||||
//
|
||||
// matinv.nj -- invert 2x2 matrices of fractions
|
||||
//
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// greatest common divisor
|
||||
|
||||
Integer gcd(Integer a, Integer b) {
|
||||
local Integer h;
|
||||
while (b != 0) {
|
||||
h = a % b;
|
||||
a = b;
|
||||
b = h;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// fractions
|
||||
|
||||
type Fraction = record {
|
||||
Integer num;
|
||||
Integer den;
|
||||
};
|
||||
|
||||
Fraction newFraction(Integer num, Integer den) {
|
||||
local Integer n;
|
||||
local Integer d;
|
||||
local Integer g;
|
||||
local Fraction r;
|
||||
if (num < 0) {
|
||||
n = -num;
|
||||
} else {
|
||||
n = num;
|
||||
}
|
||||
if (den < 0) {
|
||||
d = -den;
|
||||
} else {
|
||||
d = den;
|
||||
}
|
||||
g = gcd(n, d);
|
||||
r = new(Fraction);
|
||||
if ((num < 0) != (den < 0)) {
|
||||
r.num = -n / g;
|
||||
} else {
|
||||
r.num = n / g;
|
||||
}
|
||||
r.den = d / g;
|
||||
return r;
|
||||
}
|
||||
|
||||
void writeFraction(Fraction f) {
|
||||
writeInteger(f.num);
|
||||
writeString("/");
|
||||
writeInteger(f.den);
|
||||
}
|
||||
|
||||
Fraction negFraction(Fraction f) {
|
||||
return newFraction(-f.num, f.den);
|
||||
}
|
||||
|
||||
Fraction addFraction(Fraction f1, Fraction f2) {
|
||||
return newFraction(f1.num * f2.den + f2.num * f1.den, f1.den * f2.den);
|
||||
}
|
||||
|
||||
Fraction subFraction(Fraction f1, Fraction f2) {
|
||||
return newFraction(f1.num * f2.den - f2.num * f1.den, f1.den * f2.den);
|
||||
}
|
||||
|
||||
Fraction mulFraction(Fraction f1, Fraction f2) {
|
||||
return newFraction(f1.num * f2.num, f1.den * f2.den);
|
||||
}
|
||||
|
||||
Fraction divFraction(Fraction f1, Fraction f2) {
|
||||
return newFraction(f1.num * f2.den, f1.den * f2.num);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// 2x2 matrices of fractions
|
||||
|
||||
type Matrix = Fraction[][];
|
||||
|
||||
Matrix newMatrix(Fraction a00, Fraction a01,
|
||||
Fraction a10, Fraction a11) {
|
||||
local Matrix m;
|
||||
m = new(Fraction[2][]);
|
||||
m[0] = new(Fraction[2]);
|
||||
m[1] = new(Fraction[2]);
|
||||
m[0][0] = a00;
|
||||
m[0][1] = a01;
|
||||
m[1][0] = a10;
|
||||
m[1][1] = a11;
|
||||
return m;
|
||||
}
|
||||
|
||||
void writeMatrix(Matrix m) {
|
||||
local Integer i;
|
||||
local Integer j;
|
||||
i = 0;
|
||||
while (i < sizeof(m)) {
|
||||
j = 0;
|
||||
while (j < sizeof(m[i])) {
|
||||
writeFraction(m[i][j]);
|
||||
writeString(" ");
|
||||
j = j + 1;
|
||||
}
|
||||
writeString("\n");
|
||||
i = i + 1;
|
||||
}
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
Matrix invertMatrix(Matrix m) {
|
||||
local Fraction det;
|
||||
det = subFraction(mulFraction(m[0][0], m[1][1]),
|
||||
mulFraction(m[0][1], m[1][0]));
|
||||
if (det.num == 0) {
|
||||
writeString("error: matrix cannot be inverted\n");
|
||||
exit();
|
||||
}
|
||||
return newMatrix(
|
||||
divFraction(m[1][1], det), divFraction(negFraction(m[0][1]), det),
|
||||
divFraction(negFraction(m[1][0]), det), divFraction(m[0][0], det)
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
void main() {
|
||||
local Matrix matrix;
|
||||
local Matrix result1;
|
||||
local Matrix result2;
|
||||
writeString("\n");
|
||||
matrix = newMatrix(
|
||||
newFraction(7, 1), newFraction(4, 1),
|
||||
newFraction(6, 1), newFraction(5, 1)
|
||||
);
|
||||
writeMatrix(matrix);
|
||||
result1 = invertMatrix(matrix);
|
||||
writeMatrix(result1);
|
||||
result2 = invertMatrix(result1);
|
||||
writeMatrix(result2);
|
||||
}
|
||||
BIN
nja/nja?inline=false
Normal file
BIN
nja/nja?inline=false
Normal file
Binary file not shown.
14
njc/njc4
Executable file
14
njc/njc4
Executable file
@@ -0,0 +1,14 @@
|
||||
--2024-01-14 15:07:13-- https://git.thm.de/arin07/KSP_public/-/raw/master/aufgaben/a4/njc?inline=false
|
||||
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
|
||||
Resolving git.thm.de (git.thm.de)... 212.201.6.138
|
||||
Connecting to git.thm.de (git.thm.de)|212.201.6.138|:443... connected.
|
||||
HTTP request sent, awaiting response... 200 OK
|
||||
Length: 137095 (134K) [application/octet-stream]
|
||||
Saving to: ‘njc?inline=false’
|
||||
|
||||
0K .......... .......... .......... .......... .......... 37% 1.23M 0s
|
||||
50K .......... .......... .......... .......... .......... 74% 2.63M 0s
|
||||
100K .......... .......... .......... ... 100% 9.98M=0.06s
|
||||
|
||||
2024-01-14 15:07:14 (2.13 MB/s) - ‘njc?inline=false’ saved [137095/137095]
|
||||
|
||||
14
njc/njc5
Executable file
14
njc/njc5
Executable file
@@ -0,0 +1,14 @@
|
||||
--2024-01-14 15:07:20-- https://git.thm.de/arin07/KSP_public/-/raw/master/aufgaben/a5/njc?inline=false
|
||||
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
|
||||
Resolving git.thm.de (git.thm.de)... 212.201.6.138
|
||||
Connecting to git.thm.de (git.thm.de)|212.201.6.138|:443... connected.
|
||||
HTTP request sent, awaiting response... 200 OK
|
||||
Length: 137095 (134K) [application/octet-stream]
|
||||
Saving to: ‘njc?inline=false.1’
|
||||
|
||||
0K .......... .......... .......... .......... .......... 37% 1.21M 0s
|
||||
50K .......... .......... .......... .......... .......... 74% 2.51M 0s
|
||||
100K .......... .......... .......... ... 100% 11.2M=0.06s
|
||||
|
||||
2024-01-14 15:07:21 (2.08 MB/s) - ‘njc?inline=false.1’ saved [137095/137095]
|
||||
|
||||
14
njc/njc6
Executable file
14
njc/njc6
Executable file
@@ -0,0 +1,14 @@
|
||||
--2024-01-14 15:07:28-- https://git.thm.de/arin07/KSP_public/-/raw/master/aufgaben/a6/njc?inline=false
|
||||
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
|
||||
Resolving git.thm.de (git.thm.de)... 212.201.6.138
|
||||
Connecting to git.thm.de (git.thm.de)|212.201.6.138|:443... connected.
|
||||
HTTP request sent, awaiting response... 200 OK
|
||||
Length: 137095 (134K) [application/octet-stream]
|
||||
Saving to: ‘njc?inline=false.2’
|
||||
|
||||
0K .......... .......... .......... .......... .......... 37% 1.02M 0s
|
||||
50K .......... .......... .......... .......... .......... 74% 2.03M 0s
|
||||
100K .......... .......... .......... ... 100% 11.4M=0.07s
|
||||
|
||||
2024-01-14 15:07:28 (1.74 MB/s) - ‘njc?inline=false.2’ saved [137095/137095]
|
||||
|
||||
11070
njlisp.asm
Normal file
11070
njlisp.asm
Normal file
File diff suppressed because it is too large
Load Diff
BIN
njlisp.bin
Normal file
BIN
njlisp.bin
Normal file
Binary file not shown.
406
njvm.c
406
njvm.c
@@ -1,43 +1,397 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "config.h"
|
||||
#include "instruktion.c"
|
||||
#include "stack.c"
|
||||
#include "program.c"
|
||||
#include "codeReader.c"
|
||||
#include "debugMenu.c"
|
||||
#include "bigint.h"
|
||||
#include "record.c"
|
||||
#include "GC.c"
|
||||
#include "SDA.c"
|
||||
|
||||
void version() {
|
||||
printf("Ninja Virtual Machine version %i (compiled %s, %s)\n", PROJECT_VERSION, __DATE__, __TIME__);
|
||||
// Debug
|
||||
int debug = 0;
|
||||
|
||||
// Program
|
||||
struct program program;
|
||||
|
||||
// SDA
|
||||
struct sda sda;
|
||||
|
||||
// Stack
|
||||
struct stack stack;
|
||||
#define SIZE 64
|
||||
|
||||
//Register
|
||||
struct stack reg;
|
||||
|
||||
unsigned fp;
|
||||
|
||||
void version(void) {
|
||||
printf("Ninja Virtual Machine version %i (compiled %s, %s)\n", 0, __DATE__, __TIME__);
|
||||
}
|
||||
|
||||
void help() {
|
||||
printf("usage: ./njvm [option] [option] ...\n\t--version\tshow version and exit\n\t--help\t\tshow this help and exit");
|
||||
void help(void) {
|
||||
printf("Usage: ./njvm [options] <code file>\n\t--debug\tstart virtual machine in debug mode\n\t--version\tshow version and exit\n\t--help\t\tshow this help and exit\n");
|
||||
}
|
||||
void printArgs(int argc, char *argv[]){
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
printf("%s\n", argv[i]);
|
||||
|
||||
void execute(struct program program) {
|
||||
int bp = -1;
|
||||
int i;
|
||||
char charInput;
|
||||
StackSlot tempSlot;
|
||||
ObjRef tempObj;
|
||||
ObjRef tempObj2;
|
||||
int tempInt;
|
||||
for (i = 0; i < *program.size; ++i) {
|
||||
if (debug == 1 || bp == i) debugMenu(fp, stack, &debug, i, &bp);
|
||||
if(debug == 1) printf("(%i)",i);
|
||||
switch (program.program[i] >> 24) {
|
||||
case HALT:
|
||||
if (debug == 1) printf("halt\n");
|
||||
goto end;
|
||||
case PUSHC:
|
||||
if (debug == 1) printf("pushc: %i\n", IMMEDIATE(program.program[i]));
|
||||
bigFromInt(SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case ADD:
|
||||
if (debug == 1) printf("add: %i + %i\n", peek(stack, 2), peek(stack, 1));
|
||||
bip.op2 = pop(stack).u.objRef;
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigAdd();
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case SUB:
|
||||
if (debug == 1) printf("sub: %i - %i\n", peek(stack, 2), peek(stack, 1));
|
||||
bip.op2 = pop(stack).u.objRef;
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigSub();
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case MUL:
|
||||
if (debug == 1) printf("mul: %i * %i\n", peek(stack, 2), peek(stack, 1));
|
||||
bip.op2 = pop(stack).u.objRef;
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigMul();
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case DIV:
|
||||
if (debug == 1) printf("div: %i / %i\n", peek(stack, 2), peek(stack, 1));
|
||||
bip.op2 = pop(stack).u.objRef;
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigDiv();
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case MOD:
|
||||
if (debug == 1) printf("mod: %i %% %i\n", peek(stack, 2), peek(stack, 1));
|
||||
bip.op2 = pop(stack).u.objRef;
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigDiv();
|
||||
push(stack, stackSlotWithObjRef(bip.rem));
|
||||
break;
|
||||
case RDINT:
|
||||
if (debug == 1) printf("rdint\n");
|
||||
bigRead(stdin);
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
if (debug == 1) printf("pushed %i\n", peek(stack, 1));
|
||||
break;
|
||||
case WRINT:
|
||||
if (debug == 1) printf("wrint: %i\n", peek(stack, 1));
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigPrint(stdout);
|
||||
break;
|
||||
case RDCHR:
|
||||
if (debug == 1) printf("rdchr\n");
|
||||
scanf("%c", &charInput);
|
||||
bigFromInt(charInput);
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
if (debug == 1) printf("pushed %c\n", charInput);
|
||||
break;
|
||||
case WRCHR:
|
||||
if (debug == 1) printf("wrchr: %c\n", peek(stack, 1));
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
printf("%c", bigToInt());
|
||||
break;
|
||||
case PUSHG:
|
||||
if (debug == 1) printf("pushg: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
push(stack, stackSlotWithObjRef(getSDA(SIGN_EXTEND(IMMEDIATE(program.program[i])), sda)));
|
||||
break;
|
||||
case POPG:
|
||||
if (debug == 1) printf("popg: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
setSDA(SIGN_EXTEND(IMMEDIATE(program.program[i])), pop(stack).u.objRef, sda);
|
||||
break;
|
||||
case ASF:
|
||||
if (debug == 1) printf("asf: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
push(stack, stackSlotWitchNumber(fp));
|
||||
fp = *stack.current;
|
||||
*stack.current = *stack.current + SIGN_EXTEND(IMMEDIATE(program.program[i]));
|
||||
break;
|
||||
case RSF:
|
||||
if (debug == 1) printf("rsf: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
*stack.current = fp;
|
||||
if (debug == 1) printf("pop: %i\n", peek(stack, 1));
|
||||
tempSlot = pop(stack);
|
||||
fp = tempSlot.u.number;
|
||||
break;
|
||||
case POPL:
|
||||
if (debug == 1) printf("popl: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
stack.stack[fp + SIGN_EXTEND(IMMEDIATE(program.program[i]))] = pop(stack);
|
||||
break;
|
||||
case PUSHL:
|
||||
if (debug == 1) printf("pushl: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
push(stack, stack.stack[fp + SIGN_EXTEND(IMMEDIATE(program.program[i]))]);
|
||||
break;
|
||||
case NE:
|
||||
if (debug == 1) printf("ne: %i != %i\n", peek(stack, 2), peek(stack, 1));
|
||||
bip.op2 = pop(stack).u.objRef;
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigFromInt(bigCmp() != 0);
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case EQ:
|
||||
if (debug == 1) printf("eq: %i == %i\n", peek(stack, 2), peek(stack, 1));
|
||||
bip.op2 = pop(stack).u.objRef;
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigFromInt(bigCmp() == 0);
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case LT:
|
||||
if (debug == 1) printf("lt: %i < %i\n", peek(stack, 2), peek(stack, 1));
|
||||
bip.op2 = pop(stack).u.objRef;
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigFromInt(bigCmp() < 0);
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case LE:
|
||||
if (debug == 1) printf("le: %i <= %i\n", peek(stack, 2), peek(stack, 1));
|
||||
bip.op2 = pop(stack).u.objRef;
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigFromInt(bigCmp() <= 0);
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case GT:
|
||||
if (debug == 1) printf("gt: %i > %i\n", peek(stack, 2), peek(stack, 1));
|
||||
bip.op2 = pop(stack).u.objRef;
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigFromInt(bigCmp() > 0);
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case GE:
|
||||
if (debug == 1) printf("ge: %i >= %i\n", peek(stack, 2), peek(stack, 1));
|
||||
bip.op2 = pop(stack).u.objRef;
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
bigFromInt(bigCmp() >= 0);
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case BRF:
|
||||
if (debug == 1) printf("brf: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
if (debug == 1) printf("pop: %i\n", peek(stack, 1));
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
int b = bigToInt();
|
||||
if (b == false) {
|
||||
i = SIGN_EXTEND(IMMEDIATE(program.program[i])) - 1;
|
||||
if (debug == 1) printf("new i: %i\n", i);
|
||||
} else if (b != true) {
|
||||
printf("Error: brf: %i\n", b);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case BRT:
|
||||
if (debug == 1) printf("brt: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
if (debug == 1) printf("pop: %i\n", peek(stack, 1));
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
b = bigToInt();
|
||||
if (b == true) {
|
||||
i = SIGN_EXTEND(IMMEDIATE(program.program[i])) - 1;
|
||||
if (debug == 1) printf("new i: %i\n", i);
|
||||
} else if (b != false) {
|
||||
printf("Error: brt: %i\n", b);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case JMP:
|
||||
if (debug == 1) printf("jmp: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
i = SIGN_EXTEND(IMMEDIATE(program.program[i])) - 1;
|
||||
if (debug == 1) printf("new i: %i\n", i);
|
||||
break;
|
||||
case CALL:
|
||||
if (debug == 1) printf("call: %i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
push(stack, stackSlotWitchNumber(i));
|
||||
if (debug == 1) printf("push: %i\n", i + 1);
|
||||
i = SIGN_EXTEND(IMMEDIATE(program.program[i])) - 1;
|
||||
if (debug == 1) printf("new i: %i\n", i);
|
||||
break;
|
||||
case RET:
|
||||
if (debug == 1) printf("ret\n");
|
||||
if (debug == 1) printf("pop: %i\n", peek(stack, 1));
|
||||
i = getIntValfromStackSlot(pop(stack));
|
||||
if (debug == 1) printf("new i: %i\n", i);
|
||||
break;
|
||||
case DROP:
|
||||
if (debug == 1) printf("drop\n");
|
||||
*stack.current = *stack.current - SIGN_EXTEND(IMMEDIATE(program.program[i]));
|
||||
break;
|
||||
case DUP:
|
||||
if (debug == 1) printf("dup\n");
|
||||
tempObj = pop(stack).u.objRef;
|
||||
push(stack, stackSlotWithObjRef(tempObj));
|
||||
push(stack, stackSlotWithObjRef(tempObj));
|
||||
break;
|
||||
case POPR:
|
||||
if (debug == 1) printf("popr\n");
|
||||
push(reg, pop(stack));
|
||||
break;
|
||||
case PUSHR:
|
||||
if (debug == 1) printf("pushr\n");
|
||||
push(stack, pop(reg));
|
||||
break;
|
||||
case NEW:
|
||||
if (debug == 1) printf("new\t%i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
push(stack, stackSlotWithObjRef(newRecord(SIGN_EXTEND(IMMEDIATE(program.program[i])))));
|
||||
break;
|
||||
case GETF:
|
||||
if (debug == 1) printf("getf\n");
|
||||
tempObj = pop(stack).u.objRef;
|
||||
push(stack, stackSlotWithObjRef(getField(tempObj,SIGN_EXTEND(IMMEDIATE(program.program[i])))));
|
||||
break;
|
||||
case PUTF:
|
||||
if (debug == 1) printf("putf\t%i\n", SIGN_EXTEND(IMMEDIATE(program.program[i])));
|
||||
tempObj = pop(stack).u.objRef;
|
||||
tempObj2 = pop(stack).u.objRef;
|
||||
setField(tempObj2, SIGN_EXTEND(IMMEDIATE(program.program[i])),tempObj);
|
||||
break;
|
||||
case NEWA:
|
||||
if(debug == 1) printf("newa\n");
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
push(stack, stackSlotWithObjRef(newRecord(bigToInt())));
|
||||
break;
|
||||
case GETFA:
|
||||
if(debug == 1) printf("getfa\n");
|
||||
bip.op1 = pop(stack).u.objRef;
|
||||
tempInt = bigToInt();
|
||||
tempObj = pop(stack).u.objRef;
|
||||
push(stack, stackSlotWithObjRef(getField(tempObj,bigToInt())));
|
||||
break;
|
||||
case PUTFA:
|
||||
if (debug == 1) printf("putfa\n");
|
||||
tempObj = pop(stack).u.objRef; // Value
|
||||
tempObj2 = pop(stack).u.objRef; // Index
|
||||
bip.op1 = tempObj2;
|
||||
tempInt = bigToInt();
|
||||
setField(pop(stack).u.objRef, tempInt,tempObj);
|
||||
break;
|
||||
case GETSZ:
|
||||
if (debug == 1) printf("getsz\n");
|
||||
tempObj = pop(stack).u.objRef;
|
||||
if(IS_PRIMITIVE(tempObj)) bigFromInt(-1);
|
||||
else bigFromInt(GET_ELEMENT_COUNT(tempObj));
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case PUSHN:
|
||||
if (debug == 1) printf("pushn\n");
|
||||
push(stack, stackSlotWithObjRef(NULL));
|
||||
break;
|
||||
case REFEQ:
|
||||
if (debug == 1) printf("refeq\n");
|
||||
if(pop(stack).u.objRef == pop(stack).u.objRef) bigFromInt(true);
|
||||
else bigFromInt(false);
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
case REFNE:
|
||||
if (debug == 1) printf("refeq\n");
|
||||
if(pop(stack).u.objRef != pop(stack).u.objRef) bigFromInt(true);
|
||||
else bigFromInt(false);
|
||||
push(stack, stackSlotWithObjRef(bip.res));
|
||||
break;
|
||||
}
|
||||
}
|
||||
end:
|
||||
return;
|
||||
}
|
||||
void useption(int argc, char *argv[]){
|
||||
if (argc > 1) {
|
||||
if (strcmp(argv[1], "--version") == 0) {
|
||||
version();
|
||||
} else if (strcmp(argv[1], "--help") == 0) {
|
||||
help();
|
||||
} else if (argc != 0) {
|
||||
printf("unknown command line argument '%s', try './njvm --help'", argv[1]);
|
||||
}
|
||||
}
|
||||
|
||||
void tests(void) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
printArgs(argc,argv);
|
||||
if (argc > 1) useption(argc,argv);
|
||||
else {
|
||||
// Init the Heap
|
||||
initHeap(1000);
|
||||
|
||||
// Started
|
||||
printf("Ninja Virtual Machine started\n");
|
||||
// Initialize the Stack
|
||||
int size = SIZE;
|
||||
int current = 0;
|
||||
stack.size = &size;
|
||||
stack.current = ¤t;
|
||||
stack.stack = malloc(SIZE * 1024);
|
||||
if (stack.stack == NULL) {
|
||||
perror("malloc");
|
||||
}
|
||||
|
||||
// Initialize the registery
|
||||
int rSize = 100000;
|
||||
int rCurrent = 0;
|
||||
StackSlot r[100000];
|
||||
reg.size = &rSize;
|
||||
reg.current = &rCurrent;
|
||||
reg.stack = r;
|
||||
|
||||
// Initialize ProgrammSpeicher
|
||||
int psize = 100000;
|
||||
int saveProgram = 0;
|
||||
unsigned int p[100000];
|
||||
program.size = &psize;
|
||||
program.program = p;
|
||||
program.saveProgram = &saveProgram;
|
||||
|
||||
int run = 0;
|
||||
int sizeSDA;
|
||||
|
||||
|
||||
|
||||
// Stopped
|
||||
printf("Ninja Virtual Machine stopped\n");
|
||||
if (argc > 1) {
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (strcmp(argv[i], "--debug") == 0) {
|
||||
debug = 1;
|
||||
} else if (strcmp(argv[i], "--version") == 0) {
|
||||
version();
|
||||
return 0;
|
||||
} else if (strcmp(argv[i], "--help") == 0) {
|
||||
help();
|
||||
return 0;
|
||||
} else if (strcmp(argv[i], "--stack") == 0) {
|
||||
i++;
|
||||
// TODO: implement stack size
|
||||
} else if (strcmp(argv[i], "--heap") == 0) {
|
||||
i++;
|
||||
// TODO: implement heap size
|
||||
} else if (strcmp(argv[i], "--gcpurge") == 0) {
|
||||
// TODO: implement gcpurge
|
||||
} else {
|
||||
sizeSDA = fromFile(argv[i], program);
|
||||
run = 1;
|
||||
}
|
||||
}
|
||||
// Init the sda
|
||||
ObjRef s[sizeSDA];
|
||||
sda.size = &sizeSDA;
|
||||
sda.sda = s;
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
tests();
|
||||
}
|
||||
|
||||
if (run) {
|
||||
printf("Ninja Virtual Machine started\n");
|
||||
ObjRef s[sizeSDA];
|
||||
sda.size = &sizeSDA;
|
||||
sda.sda = s;
|
||||
if (debug == 1) printProgram(program);
|
||||
execute(program);
|
||||
printf("Ninja Virtual Machine stopped\n");
|
||||
} else {
|
||||
printf("Error: no code file specified\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
BIN
njvm?inline=false.2
Normal file
BIN
njvm?inline=false.2
Normal file
Binary file not shown.
19
objref.c
Normal file
19
objref.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef OBJREF
|
||||
#define OBJREF
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct ObjRef{
|
||||
// if brkokenHeart and forward_pointer added at this point bip throws errors
|
||||
// bool brokenHeart;
|
||||
// struct ObjRef *forward_pointer;
|
||||
unsigned int size;
|
||||
unsigned char data[1];
|
||||
} *ObjRef;
|
||||
|
||||
typedef struct{
|
||||
unsigned char brokenHeart;
|
||||
ObjRef forward_pointer;
|
||||
} *ObjRefGC;
|
||||
|
||||
#endif /* ifndef OBJREF
|
||||
#define OBJREF */
|
||||
134
program.c
Normal file
134
program.c
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Created by Nils on 30.10.2023.
|
||||
*/
|
||||
#ifndef PROGRAM
|
||||
#define PROGRAM
|
||||
|
||||
#include <string.h>
|
||||
#include "instruktion.c"
|
||||
#include <stdio.h>
|
||||
|
||||
struct program {
|
||||
int *size;
|
||||
unsigned int *program;
|
||||
int *saveProgram;
|
||||
};
|
||||
|
||||
void copyToProgram(const unsigned int codeToCopy[], int size, struct program program) {
|
||||
for (int i = 0; i < size; ++i) {
|
||||
program.program[i] = codeToCopy[i];
|
||||
}
|
||||
*program.size = size;
|
||||
*program.saveProgram = 1;
|
||||
}
|
||||
|
||||
void printProgram(struct program program) {
|
||||
char c[10];
|
||||
for (int i = 0; i < *program.size; i++) {
|
||||
switch (program.program[i] >> 24) {
|
||||
case PUSHC:
|
||||
strcpy(c, "pushc");
|
||||
break;
|
||||
case ADD:
|
||||
strcpy(c, "add");
|
||||
break;
|
||||
case SUB:
|
||||
strcpy(c, "sub");
|
||||
break;
|
||||
case MUL:
|
||||
strcpy(c, "mul");
|
||||
break;
|
||||
case DIV:
|
||||
strcpy(c, "div");
|
||||
break;
|
||||
case MOD:
|
||||
strcpy(c, "mod");
|
||||
break;
|
||||
case RDINT:
|
||||
strcpy(c, "rdint");
|
||||
break;
|
||||
case WRINT:
|
||||
strcpy(c, "wrint");
|
||||
break;
|
||||
case RDCHR:
|
||||
strcpy(c, "rdchr");
|
||||
break;
|
||||
case WRCHR:
|
||||
strcpy(c, "wrchr");
|
||||
break;
|
||||
case HALT:
|
||||
strcpy(c, "halt");
|
||||
break;
|
||||
case PUSHG :
|
||||
strcpy(c, "pushg");
|
||||
break;
|
||||
case POPG:
|
||||
strcpy(c, "popg");
|
||||
break;
|
||||
case ASF:
|
||||
strcpy(c, "asf");
|
||||
break;
|
||||
case RSF:
|
||||
strcpy(c, "rsf");
|
||||
break;
|
||||
case PUSHL:
|
||||
strcpy(c, "pushl");
|
||||
break;
|
||||
case POPL:
|
||||
strcpy(c, "popl");
|
||||
break;
|
||||
case EQ:
|
||||
strcpy(c, "eq");
|
||||
break;
|
||||
case NE:
|
||||
strcpy(c, "ne");
|
||||
break;
|
||||
case LT:
|
||||
strcpy(c, "lt");
|
||||
break;
|
||||
case LE:
|
||||
strcpy(c, "le");
|
||||
break;
|
||||
case GT:
|
||||
strcpy(c, "gt");
|
||||
break;
|
||||
case GE:
|
||||
strcpy(c, "ge");
|
||||
break;
|
||||
case JMP:
|
||||
strcpy(c, "jmp");
|
||||
break;
|
||||
case BRF:
|
||||
strcpy(c, "brf");
|
||||
break;
|
||||
case BRT:
|
||||
strcpy(c, "brt");
|
||||
break;
|
||||
case CALL:
|
||||
strcpy(c, "call");
|
||||
break;
|
||||
case RET:
|
||||
strcpy(c, "ret");
|
||||
break;
|
||||
case DROP:
|
||||
strcpy(c, "drop");
|
||||
break;
|
||||
case PUSHR:
|
||||
strcpy(c, "pushr");
|
||||
break;
|
||||
case POPR:
|
||||
strcpy(c, "popr");
|
||||
break;
|
||||
case DUP:
|
||||
strcpy(c, "dup");
|
||||
break;
|
||||
default:
|
||||
strcpy(c, "ERROR");
|
||||
break;
|
||||
}
|
||||
IMMEDIATE(program.program[i]) ? printf("%03i:\t%s\t%i\n", i, c, SIGN_EXTEND(IMMEDIATE(program.program[i]))) : printf(
|
||||
"%03i:\t%s\n", i, c);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ifndef PROGRAMM */
|
||||
778
programs/matrix.asm
Normal file
778
programs/matrix.asm
Normal file
@@ -0,0 +1,778 @@
|
||||
//
|
||||
// version
|
||||
//
|
||||
.vers 7
|
||||
|
||||
//
|
||||
// execution framework
|
||||
//
|
||||
__start:
|
||||
call _main
|
||||
call _exit
|
||||
__stop:
|
||||
jmp __stop
|
||||
|
||||
//
|
||||
// Integer readInteger()
|
||||
//
|
||||
_readInteger:
|
||||
asf 0
|
||||
rdint
|
||||
popr
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void writeInteger(Integer)
|
||||
//
|
||||
_writeInteger:
|
||||
asf 0
|
||||
pushl -3
|
||||
wrint
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Character readCharacter()
|
||||
//
|
||||
_readCharacter:
|
||||
asf 0
|
||||
rdchr
|
||||
popr
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void writeCharacter(Character)
|
||||
//
|
||||
_writeCharacter:
|
||||
asf 0
|
||||
pushl -3
|
||||
wrchr
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Integer char2int(Character)
|
||||
//
|
||||
_char2int:
|
||||
asf 0
|
||||
pushl -3
|
||||
popr
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Character int2char(Integer)
|
||||
//
|
||||
_int2char:
|
||||
asf 0
|
||||
pushl -3
|
||||
popr
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void exit()
|
||||
//
|
||||
_exit:
|
||||
asf 0
|
||||
halt
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void writeString(String)
|
||||
//
|
||||
_writeString:
|
||||
asf 1
|
||||
pushc 0
|
||||
popl 0
|
||||
jmp _writeString_L2
|
||||
_writeString_L1:
|
||||
pushl -3
|
||||
pushl 0
|
||||
getfa
|
||||
call _writeCharacter
|
||||
drop 1
|
||||
pushl 0
|
||||
pushc 1
|
||||
add
|
||||
popl 0
|
||||
_writeString_L2:
|
||||
pushl 0
|
||||
pushl -3
|
||||
getsz
|
||||
lt
|
||||
brt _writeString_L1
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Integer gcd(Integer, Integer)
|
||||
//
|
||||
_gcd:
|
||||
asf 1
|
||||
jmp __2
|
||||
__1:
|
||||
pushl -4
|
||||
pushl -3
|
||||
mod
|
||||
popl 0
|
||||
pushl -3
|
||||
popl -4
|
||||
pushl 0
|
||||
popl -3
|
||||
__2:
|
||||
pushl -3
|
||||
pushc 0
|
||||
ne
|
||||
brt __1
|
||||
__3:
|
||||
pushl -4
|
||||
popr
|
||||
jmp __0
|
||||
__0:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } newFraction(Integer, Integer)
|
||||
//
|
||||
_newFraction:
|
||||
asf 4
|
||||
pushl -4
|
||||
pushc 0
|
||||
lt
|
||||
brf __5
|
||||
pushc 0
|
||||
pushl -4
|
||||
sub
|
||||
popl 0
|
||||
jmp __6
|
||||
__5:
|
||||
pushl -4
|
||||
popl 0
|
||||
__6:
|
||||
pushl -3
|
||||
pushc 0
|
||||
lt
|
||||
brf __7
|
||||
pushc 0
|
||||
pushl -3
|
||||
sub
|
||||
popl 1
|
||||
jmp __8
|
||||
__7:
|
||||
pushl -3
|
||||
popl 1
|
||||
__8:
|
||||
pushl 0
|
||||
pushl 1
|
||||
call _gcd
|
||||
drop 2
|
||||
pushr
|
||||
popl 2
|
||||
new 2
|
||||
popl 3
|
||||
pushl -4
|
||||
pushc 0
|
||||
lt
|
||||
pushl -3
|
||||
pushc 0
|
||||
lt
|
||||
ne
|
||||
brf __9
|
||||
pushl 3
|
||||
pushc 0
|
||||
pushl 0
|
||||
sub
|
||||
pushl 2
|
||||
div
|
||||
putf 0
|
||||
jmp __10
|
||||
__9:
|
||||
pushl 3
|
||||
pushl 0
|
||||
pushl 2
|
||||
div
|
||||
putf 0
|
||||
__10:
|
||||
pushl 3
|
||||
pushl 1
|
||||
pushl 2
|
||||
div
|
||||
putf 1
|
||||
pushl 3
|
||||
popr
|
||||
jmp __4
|
||||
__4:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void writeFraction(record { Integer num; Integer den; })
|
||||
//
|
||||
_writeFraction:
|
||||
asf 0
|
||||
pushl -3
|
||||
getf 0
|
||||
call _writeInteger
|
||||
drop 1
|
||||
pushc 1
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 47
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
pushl -3
|
||||
getf 1
|
||||
call _writeInteger
|
||||
drop 1
|
||||
__11:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } negFraction(record { Integer num; Integer den; })
|
||||
//
|
||||
_negFraction:
|
||||
asf 0
|
||||
pushc 0
|
||||
pushl -3
|
||||
getf 0
|
||||
sub
|
||||
pushl -3
|
||||
getf 1
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
popr
|
||||
jmp __12
|
||||
__12:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } addFraction(record { Integer num; Integer den; }, record { Integer num; Integer den; })
|
||||
//
|
||||
_addFraction:
|
||||
asf 0
|
||||
pushl -4
|
||||
getf 0
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
pushl -3
|
||||
getf 0
|
||||
pushl -4
|
||||
getf 1
|
||||
mul
|
||||
add
|
||||
pushl -4
|
||||
getf 1
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
popr
|
||||
jmp __13
|
||||
__13:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } subFraction(record { Integer num; Integer den; }, record { Integer num; Integer den; })
|
||||
//
|
||||
_subFraction:
|
||||
asf 0
|
||||
pushl -4
|
||||
getf 0
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
pushl -3
|
||||
getf 0
|
||||
pushl -4
|
||||
getf 1
|
||||
mul
|
||||
sub
|
||||
pushl -4
|
||||
getf 1
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
popr
|
||||
jmp __14
|
||||
__14:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } mulFraction(record { Integer num; Integer den; }, record { Integer num; Integer den; })
|
||||
//
|
||||
_mulFraction:
|
||||
asf 0
|
||||
pushl -4
|
||||
getf 0
|
||||
pushl -3
|
||||
getf 0
|
||||
mul
|
||||
pushl -4
|
||||
getf 1
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
popr
|
||||
jmp __15
|
||||
__15:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// record { Integer num; Integer den; } divFraction(record { Integer num; Integer den; }, record { Integer num; Integer den; })
|
||||
//
|
||||
_divFraction:
|
||||
asf 0
|
||||
pushl -4
|
||||
getf 0
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
pushl -4
|
||||
getf 1
|
||||
pushl -3
|
||||
getf 0
|
||||
mul
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
popr
|
||||
jmp __16
|
||||
__16:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Fraction[][] newMatrix(record { Integer num; Integer den; }, record { Integer num; Integer den; }, record { Integer num; Integer den; }, record { Integer num; Integer den; })
|
||||
//
|
||||
_newMatrix:
|
||||
asf 1
|
||||
pushc 2
|
||||
newa
|
||||
popl 0
|
||||
pushl 0
|
||||
pushc 0
|
||||
pushc 2
|
||||
newa
|
||||
putfa
|
||||
pushl 0
|
||||
pushc 1
|
||||
pushc 2
|
||||
newa
|
||||
putfa
|
||||
pushl 0
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 0
|
||||
pushl -6
|
||||
putfa
|
||||
pushl 0
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 1
|
||||
pushl -5
|
||||
putfa
|
||||
pushl 0
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 0
|
||||
pushl -4
|
||||
putfa
|
||||
pushl 0
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 1
|
||||
pushl -3
|
||||
putfa
|
||||
pushl 0
|
||||
popr
|
||||
jmp __17
|
||||
__17:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void writeMatrix(Fraction[][])
|
||||
//
|
||||
_writeMatrix:
|
||||
asf 2
|
||||
pushc 0
|
||||
popl 0
|
||||
jmp __20
|
||||
__19:
|
||||
pushc 0
|
||||
popl 1
|
||||
jmp __23
|
||||
__22:
|
||||
pushl -3
|
||||
pushl 0
|
||||
getfa
|
||||
pushl 1
|
||||
getfa
|
||||
call _writeFraction
|
||||
drop 1
|
||||
pushc 2
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 32
|
||||
putfa
|
||||
dup
|
||||
pushc 1
|
||||
pushc 32
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
pushl 1
|
||||
pushc 1
|
||||
add
|
||||
popl 1
|
||||
__23:
|
||||
pushl 1
|
||||
pushl -3
|
||||
pushl 0
|
||||
getfa
|
||||
getsz
|
||||
lt
|
||||
brt __22
|
||||
__24:
|
||||
pushc 1
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 10
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
pushl 0
|
||||
pushc 1
|
||||
add
|
||||
popl 0
|
||||
__20:
|
||||
pushl 0
|
||||
pushl -3
|
||||
getsz
|
||||
lt
|
||||
brt __19
|
||||
__21:
|
||||
pushc 1
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 10
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
__18:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// Fraction[][] invertMatrix(Fraction[][])
|
||||
//
|
||||
_invertMatrix:
|
||||
asf 1
|
||||
pushl -3
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 0
|
||||
getfa
|
||||
pushl -3
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 1
|
||||
getfa
|
||||
call _mulFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushl -3
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 1
|
||||
getfa
|
||||
pushl -3
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 0
|
||||
getfa
|
||||
call _mulFraction
|
||||
drop 2
|
||||
pushr
|
||||
call _subFraction
|
||||
drop 2
|
||||
pushr
|
||||
popl 0
|
||||
pushl 0
|
||||
getf 0
|
||||
pushc 0
|
||||
eq
|
||||
brf __26
|
||||
pushc 33
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 101
|
||||
putfa
|
||||
dup
|
||||
pushc 1
|
||||
pushc 114
|
||||
putfa
|
||||
dup
|
||||
pushc 2
|
||||
pushc 114
|
||||
putfa
|
||||
dup
|
||||
pushc 3
|
||||
pushc 111
|
||||
putfa
|
||||
dup
|
||||
pushc 4
|
||||
pushc 114
|
||||
putfa
|
||||
dup
|
||||
pushc 5
|
||||
pushc 58
|
||||
putfa
|
||||
dup
|
||||
pushc 6
|
||||
pushc 32
|
||||
putfa
|
||||
dup
|
||||
pushc 7
|
||||
pushc 109
|
||||
putfa
|
||||
dup
|
||||
pushc 8
|
||||
pushc 97
|
||||
putfa
|
||||
dup
|
||||
pushc 9
|
||||
pushc 116
|
||||
putfa
|
||||
dup
|
||||
pushc 10
|
||||
pushc 114
|
||||
putfa
|
||||
dup
|
||||
pushc 11
|
||||
pushc 105
|
||||
putfa
|
||||
dup
|
||||
pushc 12
|
||||
pushc 120
|
||||
putfa
|
||||
dup
|
||||
pushc 13
|
||||
pushc 32
|
||||
putfa
|
||||
dup
|
||||
pushc 14
|
||||
pushc 99
|
||||
putfa
|
||||
dup
|
||||
pushc 15
|
||||
pushc 97
|
||||
putfa
|
||||
dup
|
||||
pushc 16
|
||||
pushc 110
|
||||
putfa
|
||||
dup
|
||||
pushc 17
|
||||
pushc 110
|
||||
putfa
|
||||
dup
|
||||
pushc 18
|
||||
pushc 111
|
||||
putfa
|
||||
dup
|
||||
pushc 19
|
||||
pushc 116
|
||||
putfa
|
||||
dup
|
||||
pushc 20
|
||||
pushc 32
|
||||
putfa
|
||||
dup
|
||||
pushc 21
|
||||
pushc 98
|
||||
putfa
|
||||
dup
|
||||
pushc 22
|
||||
pushc 101
|
||||
putfa
|
||||
dup
|
||||
pushc 23
|
||||
pushc 32
|
||||
putfa
|
||||
dup
|
||||
pushc 24
|
||||
pushc 105
|
||||
putfa
|
||||
dup
|
||||
pushc 25
|
||||
pushc 110
|
||||
putfa
|
||||
dup
|
||||
pushc 26
|
||||
pushc 118
|
||||
putfa
|
||||
dup
|
||||
pushc 27
|
||||
pushc 101
|
||||
putfa
|
||||
dup
|
||||
pushc 28
|
||||
pushc 114
|
||||
putfa
|
||||
dup
|
||||
pushc 29
|
||||
pushc 116
|
||||
putfa
|
||||
dup
|
||||
pushc 30
|
||||
pushc 101
|
||||
putfa
|
||||
dup
|
||||
pushc 31
|
||||
pushc 100
|
||||
putfa
|
||||
dup
|
||||
pushc 32
|
||||
pushc 10
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
call _exit
|
||||
__26:
|
||||
pushl -3
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 1
|
||||
getfa
|
||||
pushl 0
|
||||
call _divFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushl -3
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 1
|
||||
getfa
|
||||
call _negFraction
|
||||
drop 1
|
||||
pushr
|
||||
pushl 0
|
||||
call _divFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushl -3
|
||||
pushc 1
|
||||
getfa
|
||||
pushc 0
|
||||
getfa
|
||||
call _negFraction
|
||||
drop 1
|
||||
pushr
|
||||
pushl 0
|
||||
call _divFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushl -3
|
||||
pushc 0
|
||||
getfa
|
||||
pushc 0
|
||||
getfa
|
||||
pushl 0
|
||||
call _divFraction
|
||||
drop 2
|
||||
pushr
|
||||
call _newMatrix
|
||||
drop 4
|
||||
pushr
|
||||
popr
|
||||
jmp __25
|
||||
__25:
|
||||
rsf
|
||||
ret
|
||||
|
||||
//
|
||||
// void main()
|
||||
//
|
||||
_main:
|
||||
asf 3
|
||||
pushc 1
|
||||
newa
|
||||
dup
|
||||
pushc 0
|
||||
pushc 10
|
||||
putfa
|
||||
call _writeString
|
||||
drop 1
|
||||
pushc 7
|
||||
pushc 1
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushc 4
|
||||
pushc 1
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushc 6
|
||||
pushc 1
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
pushc 5
|
||||
pushc 1
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
call _newMatrix
|
||||
drop 4
|
||||
pushr
|
||||
popl 0
|
||||
pushl 0
|
||||
call _writeMatrix
|
||||
drop 1
|
||||
pushl 0
|
||||
call _invertMatrix
|
||||
drop 1
|
||||
pushr
|
||||
popl 1
|
||||
pushl 1
|
||||
call _writeMatrix
|
||||
drop 1
|
||||
pushl 1
|
||||
call _invertMatrix
|
||||
drop 1
|
||||
pushr
|
||||
popl 2
|
||||
pushl 2
|
||||
call _writeMatrix
|
||||
drop 1
|
||||
__27:
|
||||
rsf
|
||||
ret
|
||||
146
programs/matrix.nj
Normal file
146
programs/matrix.nj
Normal file
@@ -0,0 +1,146 @@
|
||||
//
|
||||
// matinv.nj -- invert 2x2 matrices of fractions
|
||||
//
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// greatest common divisor
|
||||
|
||||
Integer gcd(Integer a, Integer b) {
|
||||
local Integer h;
|
||||
while (b != 0) {
|
||||
h = a % b;
|
||||
a = b;
|
||||
b = h;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// fractions
|
||||
|
||||
type Fraction = record {
|
||||
Integer num;
|
||||
Integer den;
|
||||
};
|
||||
|
||||
Fraction newFraction(Integer num, Integer den) {
|
||||
local Integer n;
|
||||
local Integer d;
|
||||
local Integer g;
|
||||
local Fraction r;
|
||||
if (num < 0) {
|
||||
n = -num;
|
||||
} else {
|
||||
n = num;
|
||||
}
|
||||
if (den < 0) {
|
||||
d = -den;
|
||||
} else {
|
||||
d = den;
|
||||
}
|
||||
g = gcd(n, d);
|
||||
r = new(Fraction);
|
||||
if ((num < 0) != (den < 0)) {
|
||||
r.num = -n / g;
|
||||
} else {
|
||||
r.num = n / g;
|
||||
}
|
||||
r.den = d / g;
|
||||
return r;
|
||||
}
|
||||
|
||||
void writeFraction(Fraction f) {
|
||||
writeInteger(f.num);
|
||||
writeString("/");
|
||||
writeInteger(f.den);
|
||||
}
|
||||
|
||||
Fraction negFraction(Fraction f) {
|
||||
return newFraction(-f.num, f.den);
|
||||
}
|
||||
|
||||
Fraction addFraction(Fraction f1, Fraction f2) {
|
||||
return newFraction(f1.num * f2.den + f2.num * f1.den, f1.den * f2.den);
|
||||
}
|
||||
|
||||
Fraction subFraction(Fraction f1, Fraction f2) {
|
||||
return newFraction(f1.num * f2.den - f2.num * f1.den, f1.den * f2.den);
|
||||
}
|
||||
|
||||
Fraction mulFraction(Fraction f1, Fraction f2) {
|
||||
return newFraction(f1.num * f2.num, f1.den * f2.den);
|
||||
}
|
||||
|
||||
Fraction divFraction(Fraction f1, Fraction f2) {
|
||||
return newFraction(f1.num * f2.den, f1.den * f2.num);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// 2x2 matrices of fractions
|
||||
|
||||
type Matrix = Fraction[][];
|
||||
|
||||
Matrix newMatrix(Fraction a00, Fraction a01,
|
||||
Fraction a10, Fraction a11) {
|
||||
local Matrix m;
|
||||
m = new(Fraction[2][]);
|
||||
m[0] = new(Fraction[2]);
|
||||
m[1] = new(Fraction[2]);
|
||||
m[0][0] = a00;
|
||||
m[0][1] = a01;
|
||||
m[1][0] = a10;
|
||||
m[1][1] = a11;
|
||||
return m;
|
||||
}
|
||||
|
||||
void writeMatrix(Matrix m) {
|
||||
local Integer i;
|
||||
local Integer j;
|
||||
i = 0;
|
||||
while (i < sizeof(m)) {
|
||||
j = 0;
|
||||
while (j < sizeof(m[i])) {
|
||||
writeFraction(m[i][j]);
|
||||
writeString(" ");
|
||||
j = j + 1;
|
||||
}
|
||||
writeString("\n");
|
||||
i = i + 1;
|
||||
}
|
||||
writeString("\n");
|
||||
}
|
||||
|
||||
Matrix invertMatrix(Matrix m) {
|
||||
local Fraction det;
|
||||
det = subFraction(mulFraction(m[0][0], m[1][1]),
|
||||
mulFraction(m[0][1], m[1][0]));
|
||||
if (det.num == 0) {
|
||||
writeString("error: matrix cannot be inverted\n");
|
||||
exit();
|
||||
}
|
||||
return newMatrix(
|
||||
divFraction(m[1][1], det), divFraction(negFraction(m[0][1]), det),
|
||||
divFraction(negFraction(m[1][0]), det), divFraction(m[0][0], det)
|
||||
);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
void main() {
|
||||
local Matrix matrix;
|
||||
local Matrix result1;
|
||||
local Matrix result2;
|
||||
writeString("\n");
|
||||
matrix = newMatrix(
|
||||
newFraction(7, 1), newFraction(4, 1),
|
||||
newFraction(6, 1), newFraction(5, 1)
|
||||
);
|
||||
writeMatrix(matrix);
|
||||
result1 = invertMatrix(matrix);
|
||||
writeMatrix(result1);
|
||||
result2 = invertMatrix(result1);
|
||||
writeMatrix(result2);
|
||||
}
|
||||
26
programs/newFraction.asm
Normal file
26
programs/newFraction.asm
Normal file
@@ -0,0 +1,26 @@
|
||||
_subFraction:
|
||||
asf 0
|
||||
pushl -4
|
||||
getf 0
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
pushl -3
|
||||
getf 0
|
||||
pushl -4
|
||||
getf 1
|
||||
mul
|
||||
sub
|
||||
pushl -4
|
||||
getf 1
|
||||
pushl -3
|
||||
getf 1
|
||||
mul
|
||||
call _newFraction
|
||||
drop 2
|
||||
pushr
|
||||
popr
|
||||
jmp __14
|
||||
__14:
|
||||
rsf
|
||||
ret
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user