forked from Mars999/regal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.nacl
62 lines (45 loc) · 1.47 KB
/
Makefile.nacl
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
ifndef MAKEFILE_NACL_INCLUDED
MAKEFILE_NACL_INCLUDED := 1
#
# NaCl-only
#
ifneq ($(filter nacl%,$(SYSTEM)),)
ifeq ($(filter nacl-pnacl,$(SYSTEM)),)
.PHONY: nacl.bin nacl.clean
include build/common.inc
#
# NaCl example
#
include Makefile.regal
ifndef REGAL.STATIC
$(error nacl example needs Regal.)
endif
all:: nacl.bin
clean:: nacl.clean
nacl.bin: bin/$(SYSTEM)/nacl$(BIN_EXTENSION)
nacl.clean:
$(RM) -r tmp/$(SYSTEM)/nacl/static
$(RM) -r bin/$(SYSTEM)/nacl$(BIN_EXTENSION)
NACL.SRCS += examples/nacl/main.c
NACL.SRCS.NAMES := $(notdir $(NACL.SRCS))
NACL.OBJS := $(addprefix tmp/$(SYSTEM)/nacl/static/,$(NACL.SRCS.NAMES))
NACL.OBJS := $(NACL.OBJS:.c=.o)
NACL.CFLAGS := -Iinclude
NACL.CFLAGS += -DREGAL_NAMESPACE=1
NACL.LIBS += -Llib/$(SYSTEM) -lRegallib -lglslopt -lpnglib -lzlib
NACL.LIBS += -lm -pthread -lppapi -lppapi_gles2 -lstdc++
-include $(NACL.DEPS)
tmp/$(SYSTEM)/nacl/static/%.o: examples/nacl/%.c
@mkdir -p $(dir $@)
$(LOG_CC)$(CC) $(CFLAGS) -std=gnu99 $(NACL.CFLAGS) $(CFLAGS.SO) -o $@ -c $<
bin/$(SYSTEM)/nacl$(BIN_EXTENSION): lib/$(SYSTEM)/$(REGAL.STATIC) lib/$(SYSTEM)/$(GLSLOPT.STATIC) $(NACL.OBJS)
@mkdir -p $(dir $@)
$(LOG_LD)$(LD) $(LDFLAGS.EXTRA) -o $@ $(NACL.OBJS) $(NACL.LIBS)
ifneq ($(STRIP),)
$(LOG_STRIP)$(STRIP) -x $@
endif
examples/nacl/nacl.nmf: bin/$(SYSTEM)/nacl$(BIN_EXTENSION)
$(NACL_SDK_ROOT)/tools/create_nmf.py -Llib/$(SYSTEM) $(NMF_FLAGS) -o $@ bin/$(SYSTEM)/nacl*.nexe -s examples/nacl
endif
endif
endif