summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile26
-rw-r--r--crypto.c4
2 files changed, 20 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 5090652..6296e9b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,23 @@
-CC=gcc
-CFLAGS=-g -O2 -Wall
-LIBS=-lcrypto
-TARGET=wii-wad-tool
-OBJECTS=main.o types.o patcher.o wii_tmd.o wii_wad.o wii_tik.o crypto.o ucs.o
-HEADERS=types.h patcher.h wii_tmd.h wii_wad.h wii_imet.h wii_tik.h crypto.h ucs.h
+# cross compilation
+CC = $(CROSS)gcc
+LD = $(CROSS)ld
+AR = $(CROSS)ar
+RANLIB = $(CROSS)ranlib
+STRIP = $(CROSS)strip
+
+# flags
+CFLAGS = -g -O2 -Wall
+LIBS = -lcrypto
+
+# mingw windows compilation
+ifeq ($(findstring mingw,$(shell $(CC) --version)), mingw)
+CFLAGS += -mms-bitfields
+EXEEXT = .exe
+endif
+
+TARGET = wadtool$(EXEEXT)
+OBJECTS = main.o types.o patcher.o wii_tmd.o wii_wad.o wii_tik.o crypto.o ucs.o
+HEADERS = types.h patcher.h wii_tmd.h wii_wad.h wii_imet.h wii_tik.h crypto.h ucs.h
$(TARGET): $(OBJECTS) $(HEADERS)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
diff --git a/crypto.c b/crypto.c
index f8d4b1f..d0f77dd 100644
--- a/crypto.c
+++ b/crypto.c
@@ -3,13 +3,9 @@
*/
#include <stddef.h>
-#ifdef __WIN32__
-/* todo */
-#else
#include <openssl/md5.h>
#include <openssl/sha.h>
#include <openssl/aes.h>
-#endif
#include <stdlib.h>
#include <string.h>
#include "crypto.h"