From ec40f757478783f88e16bdb5bc36655c361cb80b Mon Sep 17 00:00:00 2001 From: Schala Date: Fri, 22 May 2015 22:15:48 -0700 Subject: [PATCH] Replaced makefile with CMakeLists.txt and #ifdef __APPLE__ with #ifndef _WIN32 --- .gitignore | 23 +++++++++++++++++++++++ CMakeLists.txt | 3 +++ Makefile | 17 ----------------- main.c | 4 ++-- 4 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 .gitignore create mode 100644 CMakeLists.txt delete mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5065d6c --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +.directory +.DS_Store +cmake_install.cmake +CMakeFiles/ +CMakeCache.txt +Makefile +NMakefile +Thumbs.db +*.asm +*.cbp +*.exe +*.filters +*.o +*.obj +*.out +*.sln +*.smc +*.suo +*.user +*.vcproj +*.vcxproj +*.workspace +*.xcodeproj diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..08422f1 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,3 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 3.1) +PROJECT(DisPel) +ADD_EXECUTABLE(dispel 65816.c main.c) diff --git a/Makefile b/Makefile deleted file mode 100644 index c644800..0000000 --- a/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -CC=gcc -CFLAGS=-Wall -O2 -LDFLAGS= -SOURCES=main.c 65816.c -OBJECTS=$(SOURCES:.c=.o) -EXECUTABLE=dispel.exe - -all: $(SOURCES) $(EXECUTABLE) - -$(EXECUTABLE): $(OBJECTS) - $(CC) $(LDFLAGS) $(OBJECTS) -o $@ - -.c.o: - $(CC) -c $(CFLAGS) $< -o $@ - -clean: - rm *.o ${EXECUTABLE} diff --git a/main.c b/main.c index 44b1dca..46400d3 100644 --- a/main.c +++ b/main.c @@ -8,7 +8,7 @@ #include #include -#ifdef __APPLE__ +#ifndef _WIN32 #include #else #include @@ -275,7 +275,7 @@ int main(int argc, char *argv[]) } // Read the file into memory -#ifdef __APPLE__ +#ifndef _WIN32 fseek(fin, 0L, SEEK_END); len = ftell(fin); fseek(fin, 0L, SEEK_SET);