-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·49 lines (37 loc) · 1.21 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
IDIR=include
CC=gcc
CCXX=g++
CFLAGS=-I$(IDIR) -O3 -ffast-math
SRCDIR=src
OUTDIR=bin
OBJDIR=$(OUTDIR)/obj
VENDORDIR=$(SRCDIR)/vendor
LDIR=lib
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LIBS=-framework OpenGL -lm -lglfw -lglew
else
LIBS=-lm -lglfw -lGLEW -lGL -lpng -lz
endif
_DEPS = camera.h common.h core.h domain_transform.h filter.h gim.h graphics_math.h graphics.h hash_map.h menu.h obj.h parametrization.h util.h
DEPS = $(patsubst %,$(SRCDIR)/%,$(_DEPS))
_OBJ = camera.o core.o domain_transform.o filter.o gim.o graphics_math.o graphics.o hash_map.o main.o menu.o obj.o parametrization.o util.o
OBJ = $(patsubst %,$(OBJDIR)/%,$(_OBJ))
_VENDOR = imgui.o imgui_demo.o imgui_draw.o imgui_impl_glfw.o imgui_impl_opengl3.o imgui_widgets.o
VENDOR = $(patsubst %,$(OBJDIR)/%,$(_VENDOR))
all: gimmesh
$(OBJDIR)/%.o: $(VENDORDIR)/%.cpp $(DEPS)
$(shell mkdir -p $(@D))
$(CCXX) -c -o $@ $< $(CFLAGS)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp $(DEPS)
$(shell mkdir -p $(@D))
$(CCXX) -c -o $@ $< $(CFLAGS)
$(OBJDIR)/%.o: $(SRCDIR)/%.c $(DEPS)
$(shell mkdir -p $(@D))
$(CC) -c -o $@ $< $(CFLAGS)
gimmesh: $(OBJ) $(VENDOR)
$(shell mkdir -p $(@D))
$(CCXX) -o $(OUTDIR)/$@ $^ $(CFLAGS) $(LIBS)
.PHONY: clean
clean:
rm -r $(OUTDIR)