PROGRAM = pipeserver
FILES = arrays calllists clear clipplane current decode disable drawpixels \
	feather fog geometry lights lightning2 main map materials matrices \
	normal papi pixelmap print readpixels stipple stream swap \
	targa_loader texture viewport window writeback

ifeq ($(ARCH), WIN_NT)
FILES += winservice
endif

LIBRARIES = wireglutil glcontext

SLOP = decode.c opcode_formats.c

PRECOMP = decode.c opcode_formats.c

CFLAGS += -DINSTRUMENT
CXXFLAGS += -DINSTRUMENT

include ../../humper.mk

decode.c: unpacker.py unpacker_special unpacker_state_special unpacker_vector_special ../opengl_stub/internal_header_special
	@$(ECHO) Generating the Unpacker...
	@PYTHONPATH=$(WORK_ROOT)/wiregl/opengl_stub python unpacker.py > decode.c

opcode_formats.c: opcode_formats.py
	@$(ECHO) Generating the Opcode Formats
	@PYTHONPATH=$(WORK_ROOT)/wiregl/opengl_stub python opcode_formats.py > opcode_formats.c

ifdef WINDOWS
LDFLAGS += ws2_32.lib opengl32.lib gdi32.lib user32.lib advapi32.lib
else
LDFLAGS += -L/usr/X11R6/lib -lGL -lXmu -lXext -lX11
endif
