Added support for cross-compiling to mingw (#5)
[full-beans.git] / Makefile
blob03d72eee9b2b1d178873f2f95723ae00fc92d569
1 CFLAGS ?= -DNDEBUG -O3 -Wall -Wextra -pedantic -std=c99
2 LDLIBS = -lm
3 SOURCES := main.c renderer.c microui.c
4 OBJECTS := $(SOURCES:%.c=%.o)
5 DEPS := $(SOURCES:%.c=%.d)
6 CFLAGS += -MMD
7 TARGET = native
8 MAIN = main
10 $(MAIN): $(OBJECTS)
11 $(CC) -o $(MAIN) $(OBJECTS) $(LDLIBS)
13 -include $(DEPS)
15 ifeq ($(OS),Windows_NT)
16 MAIN = main.exe
17 LDLIBS += -lgdi32
18 else ifeq ($(TARGET), mingw)
19 MAIN = main.exe
20 export CC = x86_64-w64-mingw32-gcc
21 LDLIBS += -lgdi32
22 else
23 UNAME_S := $(shell uname -s)
24 ifeq ($(UNAME_S),Darwin)
25 LDLIBS += -framework Cocoa
26 else
27 LDLIBS += -lX11
28 endif
29 endif
31 clean:
32 rm -f main $(OBJECTS) $(DEPS)
34 .PHONY: clean