fixed bugs and added enough runtime to execute first code after the compiler segfaults at shutdown
This commit is contained in:
28
runtime/Makefile
Normal file
28
runtime/Makefile
Normal file
@@ -0,0 +1,28 @@
|
||||
CC := g++
|
||||
CFLAGS := -Wall
|
||||
CFLAGS += -std=c++11
|
||||
CFLAGS += -Os
|
||||
LFLAGS :=
|
||||
|
||||
all: binaries
|
||||
|
||||
binaries: bin_main
|
||||
|
||||
SRC := ../output/
|
||||
|
||||
OUTPUT_DEPS := $(SRC)consts.h $(SRC)heap.h $(SRC)functions.h runtime.h $(SRC)output.cpp
|
||||
|
||||
MAIN_OBJ_DEPS := output.o main.o
|
||||
|
||||
bin_main: $(MAIN_OBJ_DEPS)
|
||||
$(CC) -o main $(MAIN_OBJ_DEPS)
|
||||
|
||||
main.o: $(OUTPUT_DEPS)
|
||||
$(CC) -o main.o -c main.cpp
|
||||
|
||||
output.o: $(OUTPUT_DEPS)
|
||||
$(CC) -I$(SRC) -o output.o -c $(SRC)output.cpp
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf *.o main
|
||||
16
runtime/main.cpp
Normal file
16
runtime/main.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
** Practice runtime for Yab2Cpp
|
||||
**
|
||||
** by Samuel D. Crow
|
||||
*/
|
||||
#include "runtime.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
unsigned int ret=run();
|
||||
if (ret!=EXIT)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
22
runtime/runtime.h
Normal file
22
runtime/runtime.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
** Practice runtime header for Yab2Cpp
|
||||
**
|
||||
** by Samuel D. Crow
|
||||
*/
|
||||
#ifndef YAB_RUNTIME
|
||||
#define YAB_RUTTIME
|
||||
|
||||
#include <cstdio>
|
||||
using namespace std;
|
||||
|
||||
enum STATES:unsigned int
|
||||
{
|
||||
EXIT,
|
||||
UNDEFINED_STATE_ERROR,
|
||||
START
|
||||
};
|
||||
|
||||
/* function prototype */
|
||||
unsigned int run();
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user