1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-12-15 17:21:22 +01:00
imgui/examples/example_sdl2_metal/Makefile

48 lines
1.2 KiB
Makefile
Raw Normal View History

2020-02-07 21:48:59 +01:00
#
# You will need SDL2 (http://www.libsdl.org):
# brew install sdl2
#
#CXX = g++
#CXX = clang++
EXE = example_sdl2_metal
IMGUI_DIR = ../..
2020-02-07 21:48:59 +01:00
SOURCES = main.mm
2020-10-07 12:04:28 +02:00
SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp
SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl2.cpp $(IMGUI_DIR)/backends/imgui_impl_metal.mm
2020-02-07 21:48:59 +01:00
OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES))))
LIBS = -framework Metal -framework MetalKit -framework Cocoa -framework IOKit -framework CoreVideo -framework QuartzCore
LIBS += `sdl2-config --libs`
LIBS += -L/usr/local/lib
CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -I/usr/local/include
2020-02-07 21:48:59 +01:00
CXXFLAGS += `sdl2-config --cflags`
CXXFLAGS += -Wall -Wformat
CFLAGS = $(CXXFLAGS)
%.o:%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
%.o:$(IMGUI_DIR)/%.cpp
2020-02-07 21:48:59 +01:00
$(CXX) $(CXXFLAGS) -c -o $@ $<
%.o:$(IMGUI_DIR)/backends/%.cpp
2020-02-07 21:48:59 +01:00
$(CXX) $(CXXFLAGS) -c -o $@ $<
%.o:%.mm
2020-02-07 21:48:59 +01:00
$(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $<
%.o:$(IMGUI_DIR)/backends/%.mm
2020-02-07 21:48:59 +01:00
$(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $<
all: $(EXE)
@echo Build complete
$(EXE): $(OBJS)
$(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
clean:
rm -f $(EXE) $(OBJS)