Adding support for hardware native and removed unneeded lines in .gitignore
This commit is contained in:
parent
5c4c6aee71
commit
4b2fce69b0
|
@ -14,59 +14,13 @@
|
||||||
## You should have received a copy of the GNU General Public License
|
## You should have received a copy of the GNU General Public License
|
||||||
## along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
|
## along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Prerequisites
|
# Generated files
|
||||||
*.d
|
tape_01
|
||||||
|
tape_02
|
||||||
# Object files
|
|
||||||
*.o
|
|
||||||
*.ko
|
|
||||||
*.obj
|
|
||||||
*.elf
|
|
||||||
|
|
||||||
# Linker output
|
|
||||||
*.ilk
|
|
||||||
*.map
|
|
||||||
*.exp
|
|
||||||
|
|
||||||
# Precompiled Headers
|
|
||||||
*.gch
|
|
||||||
*.pch
|
|
||||||
|
|
||||||
# Libraries
|
|
||||||
*.lib
|
|
||||||
*.a
|
|
||||||
*.la
|
|
||||||
*.lo
|
|
||||||
|
|
||||||
# Shared objects (inc. Windows DLLs)
|
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.so.*
|
|
||||||
*.dylib
|
|
||||||
|
|
||||||
# Executables
|
|
||||||
*.exe
|
|
||||||
*.out
|
|
||||||
*.app
|
|
||||||
*.i*86
|
|
||||||
*.x86_64
|
|
||||||
*.hex
|
|
||||||
|
|
||||||
# Debug files
|
|
||||||
*.dSYM/
|
|
||||||
*.su
|
|
||||||
*.idb
|
|
||||||
*.pdb
|
|
||||||
|
|
||||||
# Kernel Module Compile Results
|
|
||||||
*.mod*
|
|
||||||
*.cmd
|
|
||||||
.tmp_versions/
|
|
||||||
modules.order
|
|
||||||
Module.symvers
|
|
||||||
Mkfile.old
|
|
||||||
dkms.conf
|
|
||||||
|
|
||||||
# Directories storing data that should be ignored
|
# Directories storing data that should be ignored
|
||||||
bin/
|
bin/
|
||||||
temp/
|
temp/
|
||||||
|
test/scratch/
|
||||||
|
scratch/
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
/* Copyright (C) 2016 Jeremiah Orians
|
||||||
|
* This file is part of M2-Planet.
|
||||||
|
*
|
||||||
|
* M2-Planet is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* M2-Planet is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include<stdlib.h>
|
||||||
|
#include<stdio.h>
|
||||||
|
#include<string.h>
|
||||||
|
#include"cc.h"
|
||||||
|
|
||||||
|
/* The core functions */
|
||||||
|
void initialize_types();
|
||||||
|
struct token_list* read_all_tokens(FILE* a, struct token_list* current, char* filename);
|
||||||
|
struct token_list* reverse_list(struct token_list* head);
|
||||||
|
struct token_list* program();
|
||||||
|
void recursive_output(struct token_list* i, FILE* out);
|
||||||
|
int match(char* a, char* b);
|
||||||
|
void file_print(char* s, FILE* f);
|
||||||
|
char* parse_string(char* string);
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
hold_string = calloc(MAX_STRING, sizeof(char));
|
||||||
|
FILE* in = fopen("tape_01", "r");
|
||||||
|
FILE* destination_file = fopen("tape_02", "w");
|
||||||
|
Architecture = KNIGHT_NATIVE;
|
||||||
|
|
||||||
|
global_token = read_all_tokens(in, global_token, "tape_01");
|
||||||
|
|
||||||
|
if(NULL == global_token)
|
||||||
|
{
|
||||||
|
file_print("Either no input files were given or they were empty\n", stderr);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
global_token = reverse_list(global_token);
|
||||||
|
|
||||||
|
initialize_types();
|
||||||
|
reset_hold_string();
|
||||||
|
output_list = NULL;
|
||||||
|
program();
|
||||||
|
|
||||||
|
/* Output the program we have compiled */
|
||||||
|
file_print("\n# Core program\n", destination_file);
|
||||||
|
recursive_output(output_list, destination_file);
|
||||||
|
file_print("\n\n# Program global variables\n", destination_file);
|
||||||
|
recursive_output(globals_list, destination_file);
|
||||||
|
file_print("\n# Program strings\n", destination_file);
|
||||||
|
recursive_output(strings_list, destination_file);
|
||||||
|
file_print("\n:STACK\n", destination_file);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
18
makefile
18
makefile
|
@ -42,6 +42,24 @@ M2-Planet: bin results cc.h cc_reader.c cc_strings.c cc_types.c cc_core.c cc.c
|
||||||
gcc_req.h \
|
gcc_req.h \
|
||||||
-o bin/M2-Planet
|
-o bin/M2-Planet
|
||||||
|
|
||||||
|
M2-minimal: bin results cc.h cc_reader.c cc_strings.c cc_types.c cc_core.c cc-minimal.c
|
||||||
|
$(CC) $(CFLAGS) \
|
||||||
|
functions/match.c \
|
||||||
|
functions/in_set.c \
|
||||||
|
functions/numerate_number.c \
|
||||||
|
functions/file_print.c \
|
||||||
|
functions/number_pack.c \
|
||||||
|
functions/string.c \
|
||||||
|
functions/require.c \
|
||||||
|
cc_reader.c \
|
||||||
|
cc_strings.c \
|
||||||
|
cc_types.c \
|
||||||
|
cc_core.c \
|
||||||
|
cc-minimal.c \
|
||||||
|
cc.h \
|
||||||
|
gcc_req.h \
|
||||||
|
-o bin/M2-minimal
|
||||||
|
|
||||||
# Clean up after ourselves
|
# Clean up after ourselves
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|
Loading…
Reference in New Issue