blob: c1aaa36c7c62012fac6568b3a866f8120f34fe0c (
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
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
# Copyright 2012 Google Inc. All Rights Reserved.
# Author: yugui@google.com (Yugui Sonoda)
include Makefile
-include uncommon.mk
NACL_SDK_ROOT=@NACL_SDK_ROOT@
NACL_TOOLCHAIN=@NACL_TOOLCHAIN@
NACL_TOOLCHAIN_DIR=$(NACL_SDK_ROOT)/toolchain/$(NACL_TOOLCHAIN)
CC:=$(NACL_TOOLCHAIN_DIR)/bin/$(CC)
LD:=$(NACL_TOOLCHAIN_DIR)/bin/$(LD)
NM:=$(NACL_TOOLCHAIN_DIR)/bin/$(NM)
AR:=$(NACL_TOOLCHAIN_DIR)/bin/$(AR)
AS:=$(NACL_TOOLCHAIN_DIR)/bin/$(AS)
RANLIB:=$(NACL_TOOLCHAIN_DIR)/bin/$(RANLIB)
OBJDUMP:=$(NACL_TOOLCHAIN_DIR)/bin/$(OBJDUMP)
OBJCOPY:=$(NACL_TOOLCHAIN_DIR)/bin/$(OBJCOPY)
PYTHON=@PYTHON@
PPROGRAM=pepper-$(PROGRAM)
PEPPER_LIBS=-lppapi
PROGRAM_NMF=$(PROGRAM:.nexe=.nmf)
PPROGRAM_NMF=$(PPROGRAM:.nexe=.nmf)
GNUmakefile: $(srcdir)/nacl/GNUmakefile.in
$(PPROGRAM): $(PROGRAM) pepper_main.$(OBJEXT)
$(Q)$(MAKE) $(MFLAGS) PROGRAM=$(PPROGRAM) MAINOBJ="pepper_main.$(OBJEXT)" LIBS="$(LIBS) $(PEPPER_LIBS)" program
$(PROGRAM_NMF) $(PPROGRAM_NMF): $(@:.nmf=.nexe) nacl/create_nmf.rb
.PHONY: pprogram package show_naclflags
.SUFFIXES: .nexe .nmf
.nexe.nmf:
$(ECHO) generating manifest $@
$(Q)$(MINIRUBY) $(srcdir)/nacl/create_nmf.rb --verbose=$(V) $(@:.nmf=.nexe) $@
pepper_main.$(OBJEXT): $(srcdir)/nacl/pepper_main.c
@$(ECHO) compiling nacl/pepper_main.c
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@ -c $(srcdir)/nacl/pepper_main.c
ruby.$(OBJEXT):
@$(ECHO) compiling $<
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@.tmp -c $<
$(Q) $(OBJCOPY) --weaken-symbol=rb_load_file $@.tmp $@
@-$(RM) $@.tmp
file.$(OBJEXT):
@$(ECHO) compiling $<
$(Q) $(CC) $(CFLAGS) $(XCFLAGS) $(CPPFLAGS) $(COUTFLAG)$@.tmp -c $<
$(Q) $(OBJCOPY) --weaken-symbol=rb_file_load_ok $@.tmp $@
@-$(RM) $@.tmp
.rbconfig.time:
@$(MAKE) .rbconfig.raw.time RBCONFIG=.rbconfig.raw.time
@sed \
-e 's!CONFIG\["CC"\] = .*!CONFIG\["CC"\] = "$(CC)"!' \
-e 's!CONFIG\["LD"\] = .*!CONFIG\["LD"\] = "$(LD)"!' \
-e 's!CONFIG\["NM"\] = .*!CONFIG\["NM"\] = "$(NM)"!' \
-e 's!CONFIG\["AR"\] = .*!CONFIG\["AR"\] = "$(AR)"!' \
-e 's!CONFIG\["AS"\] = .*!CONFIG\["AS"\] = "$(AS)"!' \
-e 's!CONFIG\["RANLIB"\] = .*!CONFIG\["RANLIB"\] = "$(RANLIB)"!' \
-e 's!CONFIG\["OBJDUMP"\] = .*!CONFIG\["OBJDUMP"\] = "$(OBJDUMP)"!' \
-e 's!CONFIG\["OBJCOPY"\] = .*!CONFIG\["OBJCOPY"\] = "$(OBJCOPY)"!' \
-i.bak rbconfig.rb
@touch .rbconfig.time
all: pprogram
main: $(PROGRAM_NMF)
pprogram: showflags $(PPROGRAM) $(PPROGRAM_NMF)
program: $(PROGRAM_NMF)
prog: pprogram
package: pprogram install-lib install-ext-comm install-ext-arch
$(INSTALL_DATA) $(srcdir)/nacl/example.html $(prefix)
$(ECHO) generating manifest $@
$(Q)$(MINIRUBY) $(srcdir)/nacl/package.rb $(prefix)
showflags: show_naclflags
show_naclflags:
@echo " NACL_SDK_ROOT = $(NACL_SDK_ROOT)"
@echo " NM = $(NM)"
@echo " AR = $(AR)"
@echo " AS = $(AS)"
@echo " RANLIB = $(RANLIB)"
@echo " OBJDUMP = $(OBJDUMP)"
@echo " OBJCOPY = $(OBJCOPY)"
clean-local::
-$(RM) $(PPROGRAM) pepper_main.$(OBJEXT) $(PROGRAM_NMF) $(PPRGORAM_NMF)
|