]> git.lizzy.rs Git - shadowclad.git/blobdiff - Makefile
It builds! It runs!
[shadowclad.git] / Makefile
index 0922628921980f3fd5b96961bd065809a39385b2..c454140a7340440a20b7b3e523423fbf3c475eec 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,7 @@
-PLATFORM ?= x86_64-linux-gnu
+#PLATFORM ?= x86_64-linux-gnu
+PLATFORM ?= x86_64-w64-mingw32
+
+CC ::= x86_64-w64-mingw32-cc
 
 BUILDDIR ?= target/$(PLATFORM)
 SRCDIR ?= src
@@ -7,7 +10,7 @@ CPPFLAGS ::= -iquotesrc/ $(CPPFLAGS)
 CFLAGS ::= -g -std=c99 -Wall -Wextra -Wpedantic -Werror \
            -Wno-error=unused-function -Wno-error=unused-parameter $(CFLAGS)
 LDFLAGS ::= $(LDFLAGS)
-LDLIBS ::= -lm -lGL -lGLEW -lglfw -lassimp $(LDLIBS)
+LDLIBS ::= -L/usr/x86_64-w64-mingw32/bin -lm -lopengl32 -lglew32 -lglfw3 -lassimp $(LDLIBS)
 
 # ######
 # Paths
@@ -42,7 +45,8 @@ depfiles ::= $(addprefix $(BUILDDIR)/, $(addsuffix .mk, $(srcfiles)))
 #else
 #      binext ::=
 #endif
-binary ::= $(BUILDDIR)/shadowclad #$(binext)
+binary ::= $(BUILDDIR)/shadowclad.exe
+#binary ::= $(BUILDDIR)/shadowclad #$(binext)
 
 # ######
 # Main build rules
@@ -52,7 +56,7 @@ binary ::= $(BUILDDIR)/shadowclad #$(binext)
 $(binary): $(objects)
        @mkdir -p $(@D)
        @echo "Linking executable"
-       @$(CC) $(LDFLAGS) -o $(binary) $^ $(LOADLIBES) $(LDLIBS)
+       $(CC) $(LDFLAGS) -o $(binary) $^ $(LOADLIBES) $(LDLIBS)
 
 # Build C translation units
 $(objects): $(BUILDDIR)/%.c.o: %.c $(BUILDDIR)/%.c.mk