Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: acbbdbc920
Fetching contributors…

Cannot retrieve contributors at this time

379 lines (311 sloc) 11.743 kb
include config/version
SHELL = /bin/sh
ifeq ($(NACL_PACKAGES_BITSIZE), 32)
SYSTEM = nacl-32
BIN_EXTENSION = .x86.nexe
CFLAGS.EXTRA = -m32
else
SYSTEM = nacl-64
BIN_EXTENSION = .x64.nexe
CFLAGS.EXTRA = -m64 -DREGAL_NO_ASSERT
#CFLAGS.EXTRA = -m64 -DREGAL_DEBUG=0 -DREGAL_ERROR=0 -DREGAL_LOG=0 -DREGAL_NO_ASSERT -DREGAL_LOG_APP=0 -DREGAL_LOG_DRIVER=0 -DREGAL_INTERNAL=0 -DREGAL_LOG_HTTP=0
endif
REGAL_NACL = 1
SYSTEM.SUPPORTED = $(shell test -f config/Makefile.$(SYSTEM) && echo 1)
ifeq ($(SYSTEM.SUPPORTED), 1)
include config/Makefile.$(SYSTEM)
else
$(error "Platform '$(SYSTEM)' not supported")
endif
REGAL_DEST ?= /usr
BINDIR ?= $(REGAL_DEST)/bin
LIBDIR ?= $(REGAL_DEST)/lib
# To disable stripping of binaries either:
# - use STRIP= on gmake command-line
# - edit this makefile to set STRIP to the empty string
#
# To disable symlinks:
# - use LN= on gmake command-line
AR ?= ar
INSTALL ?= install
STRIP ?= strip
RM ?= rm -f
LN ?= ln -sf
CFLAGS.EXTRA += -fno-exceptions -fno-rtti
ifeq ($(MAKECMDGOALS), debug)
OPT = -g
STRIP :=
else
OPT = $(POPT)
endif
INCLUDE = -Iinclude
CFLAGS = $(OPT) $(WARN) $(INCLUDE) $(CFLAGS.EXTRA)
all debug: regal.lib regal.bin
# REGAL shared and static libraries
export:
scripts/Export.py --api gl 4.2 --api wgl 4.0 --api glx 4.0 --api cgl 1.4 --api egl 1.0 --outdir src/regal
LIB.LDFLAGS := -lstdc++ -lpthread -ldl -lm -lppapi_gles2
LIB.LIBS :=
LIB.SRCS :=
LIB.SRCS += src/regal/RegalIff.cpp
LIB.SRCS += src/regal/Regal.cpp
LIB.SRCS += src/regal/RegalToken.cpp
LIB.SRCS += src/regal/RegalLog.cpp
LIB.SRCS += src/regal/RegalInit.cpp
LIB.SRCS += src/regal/RegalUtil.cpp
LIB.SRCS += src/regal/RegalConfig.cpp
LIB.SRCS += src/regal/RegalLookup.cpp
LIB.SRCS += src/regal/RegalHelper.cpp
LIB.SRCS += src/regal/RegalContext.cpp
LIB.SRCS += src/regal/RegalContextInfo.cpp
LIB.SRCS += src/regal/RegalDispatchEmu.cpp
LIB.SRCS += src/regal/RegalDispatchLog.cpp
LIB.SRCS += src/regal/RegalDispatchDebug.cpp
LIB.SRCS += src/regal/RegalDispatchError.cpp
LIB.SRCS += src/regal/RegalDispatchLoader.cpp
LIB.SRCS += src/regal/RegalDispatchNacl.cpp
LIB.SRCS += src/regal/RegalDispatchStaticES2.cpp
LIB.SRCS += src/regal/RegalDispatchStaticEGL.cpp
LIB.SRCS += src/regal/RegalDispatchMissing.cpp
LIB.SRCS += src/regal/RegalHttp.cpp
LIB.SRCS += src/regal/RegalFavicon.cpp
ifneq ($(REGAL_NACL), 1)
LIB.SRCS += src/mongoose/mongoose.c
LIB.INCLUDE += -Isrc/mongoose
endif
LIB.SRCS.NAMES := $(notdir $(LIB.SRCS))
LIB.INCLUDE += -Isrc/boost
LIB.DEPS :=
LIB.DEPS += include/GL/Regal.h
LIB.DEPS += src/regal/RegalPrivate.h
LIB.OBJS := $(addprefix tmp/$(SYSTEM)/regal/static/,$(LIB.SRCS.NAMES))
LIB.OBJS := $(LIB.OBJS:.c=.o)
LIB.OBJS := $(LIB.OBJS:.cpp=.o)
LIB.SOBJS := $(addprefix tmp/$(SYSTEM)/regal/shared/,$(LIB.SRCS.NAMES))
LIB.SOBJS := $(LIB.SOBJS:.c=.o)
LIB.SOBJS := $(LIB.SOBJS:.cpp=.o)
CFLAGS += -DREGAL_NO_HTTP
regal.lib: lib lib/$(LIB.SHARED) lib/$(LIB.STATIC)
lib:
mkdir lib
lib/$(LIB.STATIC): $(LIB.OBJS)
$(AR) cr $@ $^
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
lib/$(LIB.SHARED): $(LIB.SOBJS)
$(CC) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
ifneq ($(LN),)
$(LN) $(LIB.SHARED) lib/$(LIB.SONAME)
$(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
ifneq ($(LIB.FRAMEWORK),)
$(LN) $(LIB.SHARED) lib/$(LIB.FRAMEWORK)
endif
endif
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
tmp/$(SYSTEM)/regal/static/%.o: src/regal/%.cpp $(LIB.DEPS)
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(CFLAGS.SO) $(LIB.INCLUDE) -o $@ -c $<
tmp/$(SYSTEM)/regal/shared/%.o: src/regal/%.cpp $(LIB.DEPS)
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) $(LIB.INCLUDE) -o $@ -c $<
tmp/$(SYSTEM)/regal/static/%.o: src/mongoose/%.c $(LIB.DEPS)
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(CFLAGS.SO) $(LIB.INCLUDE) -o $@ -c $<
tmp/$(SYSTEM)/regal/shared/%.o: src/mongoose/%.c $(LIB.DEPS)
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(PICFLAG) $(CFLAGS.SO) $(LIB.INCLUDE) -o $@ -c $<
#
# RegalGLEW
#
GLEW.SRCS += src/glew/src/glew.c
GLEW.SRCS.NAMES := $(notdir $(GLEW.SRCS))
GLEW.OBJS := $(addprefix tmp/$(SYSTEM)/glew/shared/,$(GLEW.SRCS.NAMES))
GLEW.OBJS := $(GLEW.OBJS:.c=.o)
GLEW.CFLAGS := -Isrc/glew/include -Isrc/glu/include -DGLEW_EXPORTS -DGLEW_BUILD -DGLEW_REGAL
GLEW.LIBS := -Llib -lRegal
GLEW.SHARED := libRegalGLEW.$(EXT.DYNAMIC)
GLEW.STATIC := libRegalGLEW.a
glew.lib: lib lib/$(GLEW.SHARED)
tmp/$(SYSTEM)/glew/shared/%.o: src/glew/src/%.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(PICFLAG) $(GLEW.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
lib/$(GLEW.SHARED): $(GLEW.OBJS) lib/$(LIB.SHARED)
$(LD) $(LDFLAGS.DYNAMIC) -o $@ $^ $(LIB.LDFLAGS) $(GLEW.LIBS) -lpthread
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
#
# RegalGLEW glewinfo
#
GLEWINFO.SRCS += src/glew/src/glewinfo.c
GLEWINFO.SRCS.NAMES := $(notdir $(GLEWINFO.SRCS))
GLEWINFO.OBJS := $(addprefix tmp/$(SYSTEM)/glewinfo/static/,$(GLEWINFO.SRCS.NAMES))
GLEWINFO.OBJS := $(GLEWINFO.OBJS:.c=.o)
GLEWINFO.CFLAGS := -Iinclude -Isrc/glew/include -DGLEW_REGAL
GLEWINFO.LIBS += -Llib -lRegal -lRegalGLEW $(LDFLAGS.GLUT) $(LDFLAGS.AGL)
ifneq ($(filter linux%,$(SYSTEM)),)
GLEWINFO.LIBS += -lX11
endif
tmp/$(SYSTEM)/glewinfo/static/%.o: src/glew/src/%.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(GLEWINFO.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
bin/glewinfo: $(GLEWINFO.OBJS) lib/$(LIB.SHARED) lib/$(GLEW.SHARED)
$(LD) -o $@ $^ $(LIB.LDFLAGS) $(GLEWINFO.LIBS)
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
ifneq ($(filter darwin%,$(SYSTEM)),)
glut.lib:
else
#
# RegalGLUT
#
# NOT for windows...
GLUT.SRCS += src/glut/src/capturexfont.c
GLUT.SRCS += src/glut/src/glut_glxext.c
GLUT.SRCS += src/glut/src/glut_menu.c
GLUT.SRCS += src/glut/src/glut_menu2.c
GLUT.SRCS += src/glut/src/layerutil.c
# Windows and Linux...
GLUT.SRCS += src/glut/src/glut_8x13.c
GLUT.SRCS += src/glut/src/glut_9x15.c
GLUT.SRCS += src/glut/src/glut_bitmap.c
GLUT.SRCS += src/glut/src/glut_bwidth.c
GLUT.SRCS += src/glut/src/glut_cindex.c
GLUT.SRCS += src/glut/src/glut_cmap.c
GLUT.SRCS += src/glut/src/glut_cursor.c
GLUT.SRCS += src/glut/src/glut_dials.c
GLUT.SRCS += src/glut/src/glut_dstr.c
GLUT.SRCS += src/glut/src/glut_event.c
GLUT.SRCS += src/glut/src/glut_ext.c
GLUT.SRCS += src/glut/src/glut_fcb.c
GLUT.SRCS += src/glut/src/glut_fullscrn.c
GLUT.SRCS += src/glut/src/glut_gamemode.c
GLUT.SRCS += src/glut/src/glut_get.c
GLUT.SRCS += src/glut/src/glut_hel10.c
GLUT.SRCS += src/glut/src/glut_hel12.c
GLUT.SRCS += src/glut/src/glut_hel18.c
GLUT.SRCS += src/glut/src/glut_init.c
GLUT.SRCS += src/glut/src/glut_input.c
GLUT.SRCS += src/glut/src/glut_joy.c
GLUT.SRCS += src/glut/src/glut_key.c
GLUT.SRCS += src/glut/src/glut_keyctrl.c
GLUT.SRCS += src/glut/src/glut_keyup.c
GLUT.SRCS += src/glut/src/glut_mesa.c
GLUT.SRCS += src/glut/src/glut_modifier.c
GLUT.SRCS += src/glut/src/glut_mroman.c
GLUT.SRCS += src/glut/src/glut_overlay.c
GLUT.SRCS += src/glut/src/glut_roman.c
GLUT.SRCS += src/glut/src/glut_shapes.c
GLUT.SRCS += src/glut/src/glut_space.c
GLUT.SRCS += src/glut/src/glut_stroke.c
GLUT.SRCS += src/glut/src/glut_swap.c
GLUT.SRCS += src/glut/src/glut_swidth.c
GLUT.SRCS += src/glut/src/glut_tablet.c
GLUT.SRCS += src/glut/src/glut_teapot.c
GLUT.SRCS += src/glut/src/glut_tr10.c
GLUT.SRCS += src/glut/src/glut_tr24.c
GLUT.SRCS += src/glut/src/glut_util.c
GLUT.SRCS += src/glut/src/glut_vidresize.c
GLUT.SRCS += src/glut/src/glut_warp.c
GLUT.SRCS += src/glut/src/glut_win.c
GLUT.SRCS += src/glut/src/glut_winmisc.c
GLUT.SRCS += src/glut/src/glut_ppm.c
GLUT.SRCS.NAMES := $(notdir $(GLUT.SRCS))
GLUT.OBJS := $(addprefix tmp/$(SYSTEM)/glut/shared/,$(GLUT.SRCS.NAMES))
GLUT.OBJS := $(GLUT.OBJS:.c=.o)
GLUT.CFLAGS := -Isrc/glut/include -DBUILD_GLUT32 -DGLUT_BUILDING_LIB -DGLUT_STATIC
GLUT.LIBS := -Llib -lRegal
GLUT.LIBS += -lGLU -lX11 -lXmu -lXi
GLUT.LIBS += -lpthread -lm
GLUT.SHARED := libRegalGLUT.$(EXT.DYNAMIC)
GLUT.STATIC := libRegalGLUT.a
glut.lib: lib lib/$(GLUT.SHARED)
tmp/$(SYSTEM)/glut/shared/%.o: src/glut/src/%.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(PICFLAG) $(GLUT.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
lib/$(GLUT.SHARED): $(GLUT.OBJS) lib/$(LIB.SHARED)
$(LD) $(LDFLAGS.DYNAMIC) -o $@ $^ $(GLUT.LIBS)
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
endif
# Examples
regal.bin: lib bin bin/nacl$(BIN_EXTENSION)
bin:
mkdir bin
#
# dreamtorus
#
DREAMTORUS.SRCS += examples/dreamtorus/src/render.cpp
DREAMTORUS.SRCS += examples/dreamtorus/glut/code/main.cpp
DREAMTORUS.SRCS.NAMES := $(notdir $(DREAMTORUS.SRCS))
DREAMTORUS.OBJS := $(addprefix tmp/$(SYSTEM)/dreamtorus/static/,$(DREAMTORUS.SRCS.NAMES))
DREAMTORUS.OBJS := $(DREAMTORUS.OBJS:.cpp=.o)
DREAMTORUS.CFLAGS := -Iinclude -Iexamples/dreamtorus/src
DREAMTORUS.LIBS += -Llib -lRegal $(LDFLAGS.GLUT)
DREAMTORUS.LIBS += -lm -lpthread
tmp/$(SYSTEM)/dreamtorus/static/%.o: examples/dreamtorus/src/%.cpp
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(DREAMTORUS.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
tmp/$(SYSTEM)/dreamtorus/static/%.o: examples/dreamtorus/glut/code/%.cpp
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(DREAMTORUS.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
bin/dreamtorus: $(DREAMTORUS.OBJS) lib/$(LIB.SHARED)
$(LD) -o $@ $^ $(LIB.LDFLAGS) $(DREAMTORUS.LIBS)
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
#
# tiger
#
TIGER.SRCS += examples/tiger/nvpr_tiger.c
TIGER.SRCS += examples/tiger/tiger.c
TIGER.SRCS += examples/tiger/xform.c
TIGER.SRCS.NAMES := $(notdir $(TIGER.SRCS))
TIGER.OBJS := $(addprefix tmp/$(SYSTEM)/tiger/static/,$(TIGER.SRCS.NAMES))
TIGER.OBJS := $(TIGER.OBJS:.c=.o)
TIGER.CFLAGS := -Iinclude
TIGER.LIBS += -Llib -lRegalGLEW $(LDFLAGS.GLUT) -lRegal
TIGER.LIBS += -lm -lpthread
tmp/$(SYSTEM)/tiger/static/%.o: examples/tiger/%.c
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(TIGER.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
bin/tiger: $(TIGER.OBJS) lib/$(GLEW.SHARED) lib/$(LIB.SHARED)
$(LD) -o $@ $^ $(TIGER.LIBS)
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
NACLHELLOWORLD.SRCS += examples/nacl/main.cpp
NACLHELLOWORLD.SRCS.NAMES := $(notdir $(NACLHELLOWORLD.SRCS))
NACLHELLOWORLD.OBJS := $(addprefix tmp/$(SYSTEM)/nacl/static/,$(NACLHELLOWORLD.SRCS.NAMES))
NACLHELLOWORLD.OBJS := $(NACLHELLOWORLD.OBJS:.cpp=.o)
NACLHELLOWORLD.CFLAGS := -Iinclude
NACLHELLOWORLD.LIBS += -L./lib -B static -lRegal
NACLHELLOWORLD.LIBS += -lm -lpthread -lppapi -lppapi_gles2 -lstdc++
tmp/$(SYSTEM)/nacl/static/%.o: examples/nacl/%.cpp
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(NACLHELLOWORLD.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
bin/nacl$(BIN_EXTENSION): $(NACLHELLOWORLD.OBJS)
$(CC) -o $@ $^ $(NACLHELLOWORLD.LIBS)
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
#
# GLUT dependency for non-Mac builds
#
ifeq ($(filter darwin%,$(SYSTEM)),)
bin/tiger: lib/$(GLUT.SHARED)
bin/dreamtorus: lib/$(GLUT.SHARED)
endif
clean:
$(RM) -r tmp/
$(RM) -r lib/
$(RM) -f bin/nacl$(BIN_EXTENSION)
$(RM) glew.pc glewmx.pc
.PHONY: export
.PHONY: regal.lib regal.bin all debug
.PHONY: clean distclean tardist dist-win32 dist-src
Jump to Line
Something went wrong with that request. Please try again.