-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.imgui
74 lines (58 loc) · 1.61 KB
/
Makefile.imgui
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
70
71
72
73
CC=gcc
CXX=g++
RM= /bin/rm -vf
ARCH=UNDEFINED
PWD=pwd
CDR=$(shell pwd)
EDCFLAGS:=$(CFLAGS)
EDLDFLAGS:=$(LDFLAGS)
EDDEBUG:=$(DEBUG)
ifeq ($(ARCH),UNDEFINED)
ARCH=$(shell uname -m)
endif
UNAME_S := $(shell uname -s)
EDCFLAGS+= -I include/imgui -I include/backend -I include/ -Wall -O2 -std=gnu11 -I libs/gl3w -DIMGUI_IMPL_OPENGL_LOADER_GL3W
CXXFLAGS:= -I include/imgui -I include/backend -I include/ -Wall -O2 -fpermissive -std=gnu++11 -I libs/gl3w -DIMGUI_IMPL_OPENGL_LOADER_GL3W
LIBS =
ifeq ($(UNAME_S), Linux) #LINUX
ECHO_MESSAGE = "Linux"
LIBS += -lGL `pkg-config --static --libs glfw3`
LIBEXT= so
LINKOPTIONS:= -shared
CXXFLAGS += `pkg-config --cflags glfw3`
CFLAGS = $(CXXFLAGS)
endif
ifeq ($(UNAME_S), Darwin) #APPLE
ECHO_MESSAGE = "Mac OS X"
LIBEXT= dylib
LINKOPTIONS:= -dynamiclib -single_module
CXXFLAGS:= -arch $(ARCH) $(CXXFLAGS) `pkg-config --cflags glfw3`
LIBS += -arch $(ARCH) -framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo `pkg-config --libs glfw3`
LIBS += -L/usr/local/lib -L/opt/local/lib
#LIBS += -lglfw3
LIBS += -lglfw
CXXFLAGS += -I/usr/local/include -I/opt/local/include
CFLAGS = $(CXXFLAGS)
endif
BUILDGUI=src/imgui_impl_glfw.o \
src/imgui_impl_opengl3.o \
src/imgui_impl_opengl2.o \
libs/gl3w/GL/gl3w.o \
src/imgui.o \
src/imgui_demo.o \
src/imgui_draw.o \
src/imgui_widgets.o \
src/imgui_tables.o
GUITARGET=libimgui_glfw.a
all: $(GUITARGET)
$(GUITARGET): $(BUILDGUI)
ar -crus $(GUITARGET) $(BUILDGUI)
%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<
%.o: %.c
$(CC) $(EDCFLAGS) -o $@ -c $<
.PHONY: clean
clean:
$(RM) $(GUITARGET)
spotless: clean
$(RM) $(BUILDGUI)