make: support native OS
This commit is contained in:
parent
ac9ea9ca61
commit
bbb59368b7
29
Makefile
29
Makefile
|
@ -1,22 +1,25 @@
|
|||
# General
|
||||
CC= /usr/lib/mingw64-toolchain/bin/x86_64-w64-mingw32-gcc
|
||||
#CC= /usr/lib/mingw64-toolchain/bin/x86_64-w64-mingw32-gcc
|
||||
CFLAGS= -Wfatal-errors -Wall -Wextra
|
||||
LDFLAGS= -luser32 -lshell32 -ladvapi32 -ld3d9
|
||||
NASMFLAGS= -fwin64
|
||||
LDFLAGS= -s
|
||||
NASMFLAGS=
|
||||
OBJS= main.o tigr/tigr.o cpu.o ppu.o gb.o
|
||||
|
||||
# Tigr
|
||||
CFLAGS += -I ./tigr/
|
||||
# ifeq ($(OS),Windows_NT)
|
||||
LDFLAGS += -s -lopengl32 -lgdi32
|
||||
# else
|
||||
# UNAME_S := $(shell uname -s)
|
||||
# ifeq ($(UNAME_S),Darwin)
|
||||
# LDFLAGS += -framework OpenGL -framework Cocoa
|
||||
# else ifeq ($(UNAME_S),Linux)
|
||||
# LDFLAGS += -s -lGLU -lGL -lX11
|
||||
# endif
|
||||
# endif
|
||||
ifeq ($(OS),Windows_NT)
|
||||
LDFLAGS += -luser32 -lshell32 -ladvapi32 -ld3d9 -lopengl32 -lgdi32
|
||||
NASMFLAGS= -fwin64
|
||||
else
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
LDFLAGS += -framework OpenGL -framework Cocoa
|
||||
NASMFLAGS= -fmacho64
|
||||
else ifeq ($(UNAME_S),Linux)
|
||||
LDFLAGS += -s -lGLU -lGL -lX11
|
||||
NASMFLAGS= -felf64
|
||||
endif
|
||||
endif
|
||||
|
||||
# Targets
|
||||
all: rosgb
|
||||
|
|
3
cpu.c
3
cpu.c
|
@ -1,7 +1,6 @@
|
|||
#include<windows.h>
|
||||
#include<inttypes.h>
|
||||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
#include<inttypes.h>
|
||||
#include"cpu.h"
|
||||
#include"ppu.h"
|
||||
|
||||
|
|
1
cpu.h
1
cpu.h
|
@ -1,6 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include<windows.h>
|
||||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
#include<inttypes.h>
|
||||
|
|
2
gb.c
2
gb.c
|
@ -1,5 +1,5 @@
|
|||
#include<stdio.h>
|
||||
#include<stdint.h>
|
||||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
#include<time.h>
|
||||
#include"gb.h"
|
||||
|
|
8
main.c
8
main.c
|
@ -1,9 +1,9 @@
|
|||
#include<windows.h>
|
||||
#include<assert.h>
|
||||
#include<inttypes.h>
|
||||
#include<stdbool.h>
|
||||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
#include<inttypes.h>
|
||||
#include<assert.h>
|
||||
#include<stdbool.h>
|
||||
#include<string.h>
|
||||
#include<time.h>
|
||||
#include"cpu.h"
|
||||
#include"ppu.h"
|
||||
|
|
3
ppu.c
3
ppu.c
|
@ -1,7 +1,6 @@
|
|||
#include<windows.h>
|
||||
#include<stdio.h>
|
||||
#include<inttypes.h>
|
||||
#include<stdbool.h>
|
||||
#include<stdio.h>
|
||||
#include"gb.h"
|
||||
#include"ppu.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user