summaryrefslogtreecommitdiffstats
path: root/src/glew.mk
blob: 52ed9d7fcc94c98e6004af1f785c4857df91fa38 (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
# GLEW
# http://glew.sourceforge.net/

PKG            := glew
$(PKG)_VERSION := 1.5.1
$(PKG)_SUBDIR  := glew
$(PKG)_FILE    := glew-$($(PKG)_VERSION)-src.tgz
$(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-\([1-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
    install -d '$(PREFIX)/$(TARGET)/lib'
    install -m644 '$(1)/libGLEW.a' '$(PREFIX)/$(TARGET)/lib/'
    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