Changed and moved include files and changed Makefile
This commit is contained in:
parent
b7d4d52189
commit
4d0f8d0b6a
|
@ -0,0 +1,2 @@
|
||||||
|
*~
|
||||||
|
build
|
|
@ -1,2 +0,0 @@
|
||||||
*~
|
|
||||||
yemu
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "6502.h"
|
#include <yemu/6502.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
32
src/Makefile
32
src/Makefile
|
@ -1,14 +1,28 @@
|
||||||
CC = gcc
|
CC=cc
|
||||||
CFLAGS= -O2 -pedantic -Wall -Wextra
|
|
||||||
LFLAGS=
|
|
||||||
|
|
||||||
SRCFILES= main.c 6502/6502.c ocpu/ocpu.c
|
SRCFILES!=ls -d */ | sed 's/include\///' | awk 'NF' | sed 's/.*/&\*.c/g'
|
||||||
OBJFILES= yemu
|
|
||||||
|
|
||||||
.PHONY: all clean
|
BUILDDIR=../build
|
||||||
|
|
||||||
all: main
|
CFILES=$(wildcard $(SRCFILES) *.c)
|
||||||
|
OFILES=$(patsubst %.c, $(BUILDDIR)/%.o, $(CFILES))
|
||||||
|
YEMUBIN=$(BUILDDIR)/yemu
|
||||||
|
|
||||||
main:
|
INCLUDEFLAGS=-Iinclude/
|
||||||
$(CC) $(CFLAGS) $(SRCFILES) -o $(OBJFILES)
|
DEBUGFLAGS=-fsanitize=address -fsanitize=leak -fsanitize=undefined -fsanitize=pointer-compare -lasan
|
||||||
|
CFLAGS=-Wall -Wextra $(INCLUDEFLAGS) -g
|
||||||
|
LIBFLAGS=
|
||||||
|
|
||||||
|
.PHONY: all clean test
|
||||||
|
.SUFFIXES: .o .c
|
||||||
|
|
||||||
|
all: $(BUILDDIR) $(YEMUBIN)
|
||||||
|
|
||||||
|
$(BUILDDIR):
|
||||||
|
mkdir -p $(BUILDDIR)
|
||||||
|
|
||||||
|
$(YEMUBIN): $(CFILES)
|
||||||
|
$(CC) $(CFILES) -o $@ $(CFLAGS) $(LIBFLAGS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(BUILDDIR)
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
#ifndef YEMU_6502_H
|
||||||
|
#define YEMU_6502_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "../common.h"
|
#include <yemu/common.h>
|
||||||
|
|
||||||
#define MAX_MEMORY 1024*64
|
#define MAX_MEMORY 1024*64
|
||||||
|
|
||||||
|
@ -67,3 +70,5 @@ struct CPU {
|
||||||
};
|
};
|
||||||
|
|
||||||
void init6502(FILE *infile);
|
void init6502(FILE *infile);
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,2 +1,7 @@
|
||||||
|
#ifndef YEMU_COMMON_H
|
||||||
|
#define YEMU_COMMON_H
|
||||||
|
|
||||||
typedef unsigned char byte; // 8 bit
|
typedef unsigned char byte; // 8 bit
|
||||||
typedef unsigned short word; // 16 bit
|
typedef unsigned short word; // 16 bit
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,5 +1,8 @@
|
||||||
|
#ifndef YEMU_OCPU_H
|
||||||
|
#define YEMU_OCPU_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "../common.h"
|
#include <yemu/common.h>
|
||||||
|
|
||||||
#define MAX_MEMORY 1024*64
|
#define MAX_MEMORY 1024*64
|
||||||
|
|
||||||
|
@ -79,3 +82,5 @@ struct OCPU {
|
||||||
};
|
};
|
||||||
|
|
||||||
void initOCPU(FILE *infile);
|
void initOCPU(FILE *infile);
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,6 +1,6 @@
|
||||||
#include "common.h"
|
#include <yemu/common.h>
|
||||||
#include "6502/6502.h"
|
#include <yemu/6502.h>
|
||||||
#include "ocpu/ocpu.h"
|
#include <yemu/ocpu.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "ocpu.h"
|
#include <yemu/ocpu.h>
|
||||||
|
|
||||||
struct OCPU ocpu;
|
struct OCPU ocpu;
|
||||||
struct OCPU_MEMORY ocpu_mem;
|
struct OCPU_MEMORY ocpu_mem;
|
||||||
|
|
Loading…
Reference in New Issue