2014-07-09 15:32:40 -06:00
|
|
|
# $OpenBSD: Makefile,v 1.8 2014/07/09 21:32:41 jsg Exp $
|
2011-10-23 07:57:36 -06:00
|
|
|
.include <bsd.xconf.mk>
|
2014-07-09 15:32:40 -06:00
|
|
|
.include "../../config.mk"
|
2011-10-23 07:57:36 -06:00
|
|
|
|
|
|
|
MESA= ${.CURDIR}/../../../../dist/Mesa/src/mesa
|
|
|
|
MAPI= ${.CURDIR}/../../../../dist/Mesa/src/mapi
|
|
|
|
GLSL= ${.CURDIR}/../../../../dist/Mesa/src/glsl
|
|
|
|
|
|
|
|
MESA_INCLUDE= ${.CURDIR}/../../../../dist/Mesa/include
|
|
|
|
|
|
|
|
|
|
|
|
LIBGLCPP_SOURCES = \
|
|
|
|
glcpp-lex.c \
|
|
|
|
glcpp-parse.c \
|
|
|
|
pp.c
|
|
|
|
|
|
|
|
GLCPP_SOURCES = \
|
|
|
|
$(LIBGLCPP_SOURCES) \
|
2012-08-17 07:57:59 -06:00
|
|
|
ralloc.c \
|
2011-10-23 07:57:36 -06:00
|
|
|
glcpp.c
|
|
|
|
|
|
|
|
C_SOURCES = \
|
|
|
|
strtod.c \
|
|
|
|
ralloc.c \
|
|
|
|
$(LIBGLCPP_SOURCES)
|
|
|
|
|
2014-07-09 15:32:40 -06:00
|
|
|
GENERATED_CXX_SOURCES = \
|
|
|
|
glsl_lexer.cpp \
|
|
|
|
glsl_parser.cpp
|
|
|
|
|
2011-10-23 07:57:36 -06:00
|
|
|
CXX_SOURCES = \
|
2013-09-05 09:11:54 -06:00
|
|
|
ast_array_index.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
ast_expr.cpp \
|
|
|
|
ast_function.cpp \
|
|
|
|
ast_to_hir.cpp \
|
|
|
|
ast_type.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
builtin_functions.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
builtin_types.cpp \
|
|
|
|
builtin_variables.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
glsl_parser_extras.cpp \
|
|
|
|
glsl_types.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
glsl_symbol_table.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
hir_field_selection.cpp \
|
|
|
|
ir_basic_block.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
ir_builder.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
ir_clone.cpp \
|
|
|
|
ir_constant_expression.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
ir.cpp \
|
|
|
|
ir_equals.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
ir_expression_flattening.cpp \
|
|
|
|
ir_function_can_inline.cpp \
|
2012-08-17 07:57:59 -06:00
|
|
|
ir_function_detect_recursion.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
ir_function.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
ir_hierarchical_visitor.cpp \
|
|
|
|
ir_hv_accept.cpp \
|
|
|
|
ir_import_prototypes.cpp \
|
|
|
|
ir_print_visitor.cpp \
|
|
|
|
ir_reader.cpp \
|
|
|
|
ir_rvalue_visitor.cpp \
|
|
|
|
ir_set_program_inouts.cpp \
|
|
|
|
ir_validate.cpp \
|
|
|
|
ir_variable_refcount.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
linker.cpp \
|
|
|
|
link_atomics.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
link_functions.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
link_interface_blocks.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
link_uniforms.cpp \
|
|
|
|
link_uniform_initializers.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
link_uniform_block_active_visitor.cpp \
|
|
|
|
link_uniform_blocks.cpp \
|
|
|
|
link_varyings.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
loop_analysis.cpp \
|
|
|
|
loop_controls.cpp \
|
|
|
|
loop_unroll.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
lower_clip_distance.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
lower_discard.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
lower_discard_flow.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
lower_if_to_cond_assign.cpp \
|
|
|
|
lower_instructions.cpp \
|
|
|
|
lower_jumps.cpp \
|
|
|
|
lower_mat_op_to_vec.cpp \
|
|
|
|
lower_noise.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
lower_offset_array.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
lower_packed_varyings.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
lower_named_interface_blocks.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
lower_packing_builtins.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
lower_texture_projection.cpp \
|
|
|
|
lower_variable_index_to_cond_assign.cpp \
|
|
|
|
lower_vec_index_to_cond_assign.cpp \
|
|
|
|
lower_vec_index_to_swizzle.cpp \
|
|
|
|
lower_vector.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
lower_vector_insert.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
lower_output_reads.cpp \
|
|
|
|
lower_ubo_reference.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
opt_algebraic.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
opt_array_splitting.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
opt_constant_folding.cpp \
|
|
|
|
opt_constant_propagation.cpp \
|
|
|
|
opt_constant_variable.cpp \
|
|
|
|
opt_copy_propagation.cpp \
|
2012-08-17 07:57:59 -06:00
|
|
|
opt_copy_propagation_elements.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
opt_cse.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
opt_dead_builtin_varyings.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
opt_dead_code.cpp \
|
|
|
|
opt_dead_code_local.cpp \
|
|
|
|
opt_dead_functions.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
opt_flatten_nested_if_blocks.cpp \
|
|
|
|
opt_flip_matrices.cpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
opt_function_inlining.cpp \
|
|
|
|
opt_if_simplification.cpp \
|
|
|
|
opt_noop_swizzle.cpp \
|
|
|
|
opt_redundant_jumps.cpp \
|
|
|
|
opt_structure_splitting.cpp \
|
|
|
|
opt_swizzle_swizzle.cpp \
|
|
|
|
opt_tree_grafting.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
opt_vectorize.cpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
s_expression.cpp \
|
2014-07-09 15:32:40 -06:00
|
|
|
$(GENERATED_CXX_SOURCES)
|
2011-10-23 07:57:36 -06:00
|
|
|
|
2011-10-26 15:48:08 -06:00
|
|
|
LIB= libglsl
|
2011-10-23 07:57:36 -06:00
|
|
|
|
|
|
|
SRCS= \
|
|
|
|
$(C_SOURCES) \
|
2014-07-09 15:32:40 -06:00
|
|
|
$(CXX_SOURCES)
|
2011-10-23 07:57:36 -06:00
|
|
|
|
2011-10-27 01:07:39 -06:00
|
|
|
OBJS+= $(C_SOURCES:.c=.so) $(CXX_SOURCES:.cpp=.so)
|
2011-10-23 07:57:36 -06:00
|
|
|
|
|
|
|
INCLUDES= \
|
|
|
|
-I${X11BASE}/include/GL \
|
|
|
|
-I$(GLSL) \
|
|
|
|
-I$(GLSL)/glcpp \
|
2013-09-05 09:11:54 -06:00
|
|
|
-I${.CURDIR}/../../generated/glsl \
|
|
|
|
-I${.CURDIR}/../../generated/glsl/glcpp \
|
2011-10-23 07:57:36 -06:00
|
|
|
-I$(MESA) \
|
|
|
|
-I$(MAPI) \
|
|
|
|
-I$(MESA_INCLUDE)
|
|
|
|
|
|
|
|
CPPFLAGS+= $(INCLUDES) $(DEFINES)
|
|
|
|
|
2011-10-26 15:48:08 -06:00
|
|
|
all: ${LIB}_pic.a
|
2011-10-23 07:57:36 -06:00
|
|
|
|
|
|
|
obj: _xenocara_obj
|
|
|
|
|
|
|
|
install:
|
|
|
|
@echo "Not installing libglsl"
|
|
|
|
|
2011-10-26 15:48:08 -06:00
|
|
|
clean:
|
|
|
|
rm -f ${LIB}_pic.a ${OBJS}
|
|
|
|
|
|
|
|
cleandir: clean
|
2011-10-23 07:57:36 -06:00
|
|
|
|
2011-10-27 01:07:39 -06:00
|
|
|
# Tweak suffixes: only .cpp is used for C++,
|
2011-10-23 07:57:36 -06:00
|
|
|
# ignore .l and .y to avoid rebuilding cpp-{lex,parse}.c
|
|
|
|
# which need bison/recent flex.
|
|
|
|
.SUFFIXES:
|
2011-10-27 01:07:39 -06:00
|
|
|
.SUFFIXES: .a .so .c .cpp
|
2011-10-23 07:57:36 -06:00
|
|
|
|
2011-10-27 01:07:39 -06:00
|
|
|
.c.so:
|
|
|
|
@echo "${COMPILE.c} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o
|
2011-10-23 07:57:36 -06:00
|
|
|
@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
|
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
|
|
|
.cpp.so:
|
|
|
|
@echo "${COMPILE.cc} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}"
|
|
|
|
@${COMPILE.cc} ${PICFLAG} -DPIC ${.IMPSRC} -o ${.TARGET}.o
|
|
|
|
@${LD} -X -r ${.TARGET}.o -o ${.TARGET}
|
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2011-10-26 15:48:08 -06:00
|
|
|
${LIB}_pic.a: ${OBJS} $(DPADD)
|
|
|
|
@rm -f ${LIB}_pic.a
|
|
|
|
@${AR} cq ${LIB}_pic.a `${LORDER} ${OBJS} | tsort -q`
|
|
|
|
${RANLIB} ${LIB}_pic.a
|
|
|
|
|
2011-10-23 07:57:36 -06:00
|
|
|
.include <bsd.xorg.mk>
|
|
|
|
|
|
|
|
.PATH: ${GLSL}
|
|
|
|
.PATH.cpp: ${GLSL}
|
|
|
|
.PATH: ${GLSL}/glcpp
|
2013-09-05 09:11:54 -06:00
|
|
|
.PATH: ${GLSL}/builtin_compiler
|
|
|
|
.PATH: ${.CURDIR}/../../generated/glsl
|
|
|
|
.PATH: ${.CURDIR}/../../generated/glsl/glcpp
|