-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmakefile_mingw
58 lines (44 loc) · 988 Bytes
/
makefile_mingw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
ifndef CONFIG
# Build debug config by default
CONFIG=debug
endif
CC=g++
# Compiler flags
CFLAGS_debug=
CFLAGS_release=-O3
CFLAGS=-g -I. -Wall $(CFLAGS_$(CONFIG))
# Linker flags
LDFLAGS=-static -static-libgcc -static-libstdc++
LIBS=
DEPS=core.h font.h imgui.h pixie.h makefile_mingw
ifeq ($(SHELL), sh.exe)
OBJDIR=mingw\$(CONFIG)
else
OBJDIR=mingw/$(CONFIG)
endif
_OBJ=main.o pixie.o pixie_win.o imgui.o font.o
OBJ=$(patsubst %,$(OBJDIR)/%,$(_OBJ))
TARGET = $(OBJDIR)/pixie_demo.exe
$(OBJDIR)/%.o: %.cpp $(DEPS)
$(CC) $(CFLAGS) -c $< -o $@
all: init $(OBJDIR) $(TARGET)
init:
@$(CC) --version
@echo Building $(CONFIG)
$(OBJDIR):
ifeq ($(SHELL), sh.exe)
# Most likely not running under a posix shell
mkdir $@
else
mkdir -p $@
endif
$(TARGET): $(OBJ)
$(CC) $(LIBS) $(LDFLAGS) -mwindows -g -o $@ $^
.PHONY: clean init
clean: init
ifeq ($(SHELL), sh.exe)
# Most likely not running under a posix shell
if exist $(OBJDIR) rmdir /s /q $(OBJDIR)
else
-rm -rf $(OBJDIR)
endif