forked from cimgui/cimgui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (51 loc) · 1.19 KB
/
Makefile
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
59
60
61
62
63
64
65
66
67
68
69
#
# Cross Platform Makefile
# Compatible with Ubuntu 14.04.1 and macOS
OBJS = cimgui.o
OBJS += ./imgui/imgui.o
OBJS += ./imgui/imgui_draw.o
OBJS += ./imgui/imgui_demo.o
OBJS += ./imgui/imgui_tables.o
OBJS += ./imgui/imgui_widgets.o
CXXFLAGS=-O2 -fno-exceptions -fno-rtti
UNAME_S := $(shell uname -s)
AR := ar -rc
ifeq ($(UNAME_S), Linux) #LINUX
ECHO_MESSAGE = "Linux"
OUTPUTNAME = cimgui.so
CXXFLAGS += -I./imgui/
CXXFLAGS += -Wall
CXXFLAGS += -shared -fPIC
CFLAGS = $(CXXFLAGS)
endif
ifeq ($(UNAME_S), Darwin) #APPLE
ECHO_MESSAGE = "macOS"
OUTPUTNAME = cimgui.dylib
CXXFLAGS += -I/usr/local/include
CXXFLAGS += -Wall
LINKFLAGS = -dynamiclib
CFLAGS = $(CXXFLAGS)
endif
ifeq ($(OS), Windows_NT)
ECHO_MESSAGE = "Windows"
OUTPUTNAME = cimgui.dll
CXXFLAGS += -I./imgui/
CXXFLAGS += -Wall
CXXFLAGS += -shared
LINKFLAGS = -limm32
CFLAGS = $(CXXFLAGS)
endif
.cpp.o:
$(CXX) $(CXXFLAGS) -c -o $@ $<
all:$(OUTPUTNAME)
@echo Build complete for $(ECHO_MESSAGE)
static:$(OBJS)
$(AR) libcimgui.a $(OBJS)
$(OUTPUTNAME):$(OBJS)
$(CXX) -o $(OUTPUTNAME) $(OBJS) $(CXXFLAGS) $(LINKFLAGS)
clean:
rm -f $(OBJS)
fclean: clean
rm -f $(OUTPUTNAME)
re: fclean all
.PHONY: all clean fclean re static