summaryrefslogtreecommitdiffstats
path: root/src/glew.mk
blob: 6a72ccf430432baf329878575d19db409922357c (plain)
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
# GLEW

PKG            := glew
$(PKG)_VERSION := 1.5.1
$(PKG)_SUBDIR  := glew
$(PKG)_FILE    := glew-$($(PKG)_VERSION)-src.tgz
$(PKG)_WEBSITE := http://glew.sourceforge.net/
$(PKG)_URL     := http://$(SOURCEFORGE_MIRROR)/glew/$($(PKG)_FILE)
$(PKG)_DEPS    := gcc

define $(PKG)_UPDATE
    wget -q -O- 'http://sourceforge.net/project/showfiles.php?group_id=67586&package_id=67942' | \
    grep 'glew-' | \
    $(SED) -n 's,.*glew-\([0-9][^>]*\)-src\.tgz.*,\1,p' | \
    head -1
endef

define $(PKG)_BUILD
    cd '$(1)' && $(TARGET)-gcc -O2 -DGLEW_STATIC -Iinclude -c -o glew.o src/glew.c
    cd '$(1)' && $(TARGET)-ar cr libGLEW.a glew.o
    $(TARGET)-ranlib '$(1)/libGLEW.a'
    install -d '$(PREFIX)/$(TARGET)/lib'
    install -m644 '$(1)/libGLEW.a' '$(PREFIX)/$(TARGET)/lib/'
    install -m644 '$(1)/libGLEW.a' '$(PREFIX)/$(TARGET)/lib/libglew32s.a'
    install -d '$(PREFIX)/$(TARGET)/include'
    install -d '$(PREFIX)/$(TARGET)/include/GL'
    install -m644 '$(1)/include/GL/glew.h' '$(1)/include/GL/wglew.h' '$(PREFIX)/$(TARGET)/include/GL/'
endef