diff options
-rw-r--r-- | Makefile | 16 | ||||
-rw-r--r-- | Makerules | 2 | ||||
-rw-r--r-- | Makethird | 53 |
3 files changed, 52 insertions, 19 deletions
@@ -297,14 +297,6 @@ $(MUVIEW_X11_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(MUVIEW_X11) : $(MUVIEW_X11_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(LINK_CMD) $(X11_LIBS) -ifeq "$(HAVE_GLFW)" "yes" -MUVIEW_GLFW := $(OUT)/mupdf-gl -MUVIEW_GLFW_OBJ := $(addprefix $(OUT)/platform/gl/, gl-font.o gl-input.o gl-main.o) -$(MUVIEW_GLFW_OBJ) : $(FITZ_HDR) $(PDF_HDR) platform/gl/gl-app.h -$(MUVIEW_GLFW) : $(MUVIEW_GLFW_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(GLFW_LIB) - $(LINK_CMD) $(GLFW_LIBS) -endif - ifeq "$(HAVE_CURL)" "yes" MUVIEW_X11_CURL := $(OUT)/mupdf-x11-curl MUVIEW_X11_CURL_OBJ := $(addprefix $(OUT)/platform/x11/curl/, x11_main.o x11_image.o pdfapp.o curl_stream.o) @@ -314,6 +306,14 @@ $(MUVIEW_X11_CURL) : $(MUVIEW_X11_CURL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(CURL_LIB endif endif +ifeq "$(HAVE_GLFW)" "yes" +MUVIEW_GLFW := $(OUT)/mupdf-gl +MUVIEW_GLFW_OBJ := $(addprefix $(OUT)/platform/gl/, gl-font.o gl-input.o gl-main.o) +$(MUVIEW_GLFW_OBJ) : $(FITZ_HDR) $(PDF_HDR) platform/gl/gl-app.h +$(MUVIEW_GLFW) : $(MUVIEW_GLFW_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(GLFW_LIB) + $(LINK_CMD) $(GLFW_LIBS) +endif + ifeq "$(HAVE_WIN32)" "yes" MUVIEW_WIN32 := $(OUT)/mupdf MUVIEW_WIN32_OBJ := $(addprefix $(OUT)/platform/x11/, win_main.o pdfapp.o win_res.o) @@ -73,7 +73,7 @@ CFLAGS+= -U__STRICT_ANSI__ # Mac OS X doesn't have pkg-config so we hard code paths. else ifeq "$(OS)" "MACOS" -HAVE_X11 ?= yes +HAVE_X11 ?= no HAVE_PTHREADS ?= yes # Mac OS X deprecated openssl, so the default is to not include it. @@ -676,6 +676,37 @@ ifneq "$(wildcard $(GLFW_DIR)/README.md)" "" GLFW_LIB := $(OUT)/libglfw.a GLFW_OUT := $(OUT)/glfw + +ifeq "$(OS)" "MACOS" + +GLFW_SRC := \ + cocoa_init.m \ + cocoa_monitor.m \ + cocoa_window.m \ + context.c \ + init.c \ + input.c \ + iokit_joystick.m \ + mach_time.m \ + monitor.c \ + nsgl_context.m \ + posix_tls.c \ + window.c + +$(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.m | $(GLFW_OUT) + $(CC_CMD) -D_GLFW_COCOA -D_GLFW_NSGL -D_GLFW_USE_MENUBAR -D_GLFW_USE_RETINA -D_GLFW_USE_OPENGL -Wno-deprecated-declarations +$(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.c | $(GLFW_OUT) + $(CC_CMD) -D_GLFW_COCOA -D_GLFW_NSGL -D_GLFW_USE_MENUBAR -D_GLFW_USE_RETINA -D_GLFW_USE_OPENGL + +GLFW_OBJ := $(addprefix $(GLFW_OUT)/, $(GLFW_SRC)) +GLFW_OBJ := $(GLFW_OBJ:%.c=%.o) +GLFW_OBJ := $(GLFW_OBJ:%.m=%.o) + +$(GLFW_LIB): $(GLFW_OBJ) +GLFW_LIBS := -framework OpenGL -framework IOKit -framework CoreVideo -framework Cocoa + +else + GLFW_SRC := \ context.c \ glx_context.c \ @@ -689,7 +720,18 @@ GLFW_SRC := \ x11_init.c \ x11_monitor.c \ x11_window.c \ - xkb_unicode.c \ + xkb_unicode.c + +$(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.c | $(GLFW_OUT) + $(CC_CMD) -D_GLFW_X11 -D_GLFW_GLX -D_GLFW_USE_OPENGL -D_GLFW_HAS_GLXGETPROCADDRESS +$(GLFW_LIB): $(addprefix $(GLFW_OUT)/, $(GLFW_SRC:%.c=%.o)) +GLFW_LIBS := -lGL -lX11 -lXcursor -lXrandr -lXinerama -lpthread + +endif + +GLFW_CFLAGS := -I$(GLFW_DIR)/include +$(GLFW_OUT): + $(MKDIR_CMD) GLFW_SRC_UNUSED := \ egl_context.c \ @@ -708,15 +750,6 @@ GLFW_SRC_UNUSED := \ wl_monitor.c \ wl_window.c \ -$(GLFW_LIB): $(addprefix $(GLFW_OUT)/, $(GLFW_SRC:%.c=%.o)) -$(GLFW_OUT): - $(MKDIR_CMD) -$(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.c | $(GLFW_OUT) - $(CC_CMD) -D_GLFW_X11 -D_GLFW_GLX -D_GLFW_USE_OPENGL -D_GLFW_HAS_GLXGETPROCADDRESS - -GLFW_CFLAGS := -I$(GLFW_DIR)/include -GLFW_LIBS := -lGL -lX11 -lXcursor -lXrandr -lXinerama -lpthread - HAVE_GLFW := yes else ifeq "$(HAVE_GLFW)" "yes" |