diff options
Diffstat (limited to 'erts/emulator/Makefile.in')
-rw-r--r-- | erts/emulator/Makefile.in | 120 |
1 files changed, 106 insertions, 14 deletions
diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in index 574909ac7c..2a9a0a5c2f 100644 --- a/erts/emulator/Makefile.in +++ b/erts/emulator/Makefile.in @@ -22,6 +22,9 @@ include ../vsn.mk include $(ERL_TOP)/make/$(TARGET)/otp.mk -include $(TARGET)/gen_git_version.mk +ifeq ($(findstring ose,$(TARGET)),ose) +include $(ERL_TOP)/make/$(TARGET)/ose_lm.mk +endif ENABLE_ALLOC_TYPE_VARS = @ENABLE_ALLOC_TYPE_VARS@ HIPE_ENABLED=@HIPE_ENABLED@ @@ -136,6 +139,28 @@ endif endif endif +comma:=, +space:= +space+= + +STATIC_NIFS=@STATIC_NIFS@ +ifneq ($(STATIC_NIFS),no) +ifeq ($(STATIC_NIFS),yes) +STATIC_NIFS=$(ERL_TOP)/lib/asn1/priv/lib/$(TARGET)/asn1rt_nif.a \ + $(ERL_TOP)/lib/crypto/priv/lib/$(TARGET)/crypto$(TYPEMARKER).a +endif +STATIC_NIFS:=$(subst $(comma),$(space),$(STATIC_NIFS)) +endif + +STATIC_DRIVERS=@STATIC_DRIVERS@ +ifneq ($(STATIC_DRIVERS),no) +ifeq ($(STATIC_DRIVERS),yes) +STATIC_DRIVERS= +endif +STATIC_DRIVERS:=$(subst $(comma),$(space),$(STATIC_DRIVERS)) +endif + + # # NOTE: When adding a new type update ERL_BUILD_TYPE_MARKER in sys/unix/sys.c # @@ -212,7 +237,9 @@ HCC = @HCC@ LD = @LD@ DEXPORT = @DEXPORT@ RANLIB = @RANLIB@ +ifneq ($(findstring ose,$(TARGET)),ose) STRIP = strip +endif PERL = @PERL@ RM = @RM@ MKDIR = @MKDIR@ @@ -493,10 +520,9 @@ ifdef DTRACE_ENABLED # global.h causes problems by including dtrace-wrapper.h which includes # the autogenerated erlang_dtrace.h ... so make erlang_dtrace.h very early. DTRACE_HEADERS = $(TARGET)/erlang_dtrace.h -generate: $(DTRACE_HEADERS) $(GENERATE) +GENERATE+= $(DTRACE_HEADERS) else DTRACE_HEADERS = -generate: $(GENERATE) endif ifdef HIPE_ENABLED @@ -554,13 +580,13 @@ $(TTF_DIR)/erl_alloc_types.h: beam/erl_alloc.types utils/make_alloc_types GENERATE += $(TTF_DIR)/erl_alloc_types.h # version include file -$(TARGET)/erl_version.h: ../vsn.mk - $(gen_verbose)LANG=C $(PERL) utils/make_version -o $@ $(SYSTEM_VSN) $(VSN)$(SERIALNO) $(TARGET) +$(TARGET)/erl_version.h: ../vsn.mk $(ERL_TOP)/make/$(TARGET)/otp.mk + $(gen_verbose)LANG=C $(PERL) utils/make_version -o $@ $(SYSTEM_VSN) $(OTP_VERSION) $(VSN)$(SERIALNO) $(TARGET) GENERATE += $(TARGET)/erl_version.h # driver table -$(TTF_DIR)/driver_tab.c: Makefile.in - $(gen_verbose)LANG=C $(PERL) utils/make_driver_tab -o $@ $(DRV_OBJS) +$(TTF_DIR)/driver_tab.c: Makefile.in utils/make_driver_tab + $(gen_verbose)LANG=C $(PERL) utils/make_driver_tab -o $@ -nifs $(STATIC_NIF_LIBS) -drivers $(DRV_OBJS) $(STATIC_DRIVER_LIBS) GENERATE += $(TTF_DIR)/driver_tab.c @@ -645,7 +671,6 @@ endif ifneq ($(filter tile-%,$(TARGET)),) $(OBJDIR)/beam_emu.o: beam/beam_emu.c $(V_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) \ - -OPT:Olimit=0 -WOPT:lpre=off:spre=off:epre=off \ $(INCLUDES) -c $< -o $@ else # Usually the same as the default rule, but certain platforms (e.g. win32) mix @@ -666,6 +691,14 @@ $(OBJDIR)/%.o: $(TTF_DIR)/%.c $(OBJDIR)/%.o: sys/$(ERLANG_OSTYPE)/%.c $(V_CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ +ifeq ($(findstring ose,$(TARGET)),ose) +$(OBJDIR)/ose_confd.o: $(OSE_CONFD) + $(V_CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ + +$(OBJDIR)/crt0_lm.o: $(CRT0_LM) + $(V_CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ +endif + $(OBJDIR)/%.o: sys/common/%.c $(V_CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@ @@ -760,7 +793,7 @@ RUN_OBJS = \ $(OBJDIR)/erl_zlib.o $(OBJDIR)/erl_nif.o \ $(OBJDIR)/erl_bif_binary.o $(OBJDIR)/erl_ao_firstfit_alloc.o \ $(OBJDIR)/erl_thr_queue.o $(OBJDIR)/erl_sched_spec_pre_alloc.o \ - $(OBJDIR)/erl_ptab.o + $(OBJDIR)/erl_ptab.o $(OBJDIR)/erl_map.o ifeq ($(TARGET),win32) DRV_OBJS = \ @@ -768,7 +801,8 @@ DRV_OBJS = \ $(OBJDIR)/efile_drv.o \ $(OBJDIR)/inet_drv.o \ $(OBJDIR)/zlib_drv.o \ - $(OBJDIR)/ram_file_drv.o + $(OBJDIR)/ram_file_drv.o \ + $(OBJDIR)/ttsl_drv.o OS_OBJS = \ $(OBJDIR)/win_efile.o \ $(OBJDIR)/win_con.o \ @@ -780,6 +814,30 @@ OS_OBJS = \ $(OBJDIR)/sys_interrupt.o \ $(OBJDIR)/sys_env.o \ $(OBJDIR)/dosmap.o + +else +ifeq ($(findstring ose,$(TARGET)),ose) +OS_OBJS = \ + $(OBJDIR)/sys.o \ + $(OBJDIR)/driver_tab.o \ + $(OBJDIR)/ose_efile.o \ + $(OBJDIR)/gzio.o \ + $(OBJDIR)/elib_memmove.o + +OS_OBJS += $(OBJDIR)/ose_confd.o \ + $(OBJDIR)/crt0_lm.o + +OS_OBJS += $(OBJDIR)/sys_float.o \ + $(OBJDIR)/sys_time.o + +DRV_OBJS = \ + $(OBJDIR)/efile_drv.o \ + $(OBJDIR)/ose_signal_drv.o \ + $(OBJDIR)/inet_drv.o \ + $(OBJDIR)/zlib_drv.o \ + $(OBJDIR)/ram_file_drv.o \ + $(OBJDIR)/ttsl_drv.o + else OS_OBJS = \ $(OBJDIR)/sys.o \ @@ -794,10 +852,34 @@ DRV_OBJS = \ $(OBJDIR)/efile_drv.o \ $(OBJDIR)/inet_drv.o \ $(OBJDIR)/zlib_drv.o \ - $(OBJDIR)/ram_file_drv.o + $(OBJDIR)/ram_file_drv.o \ + $(OBJDIR)/ttsl_drv.o +endif +endif + +ifneq ($(STATIC_NIFS),no) +STATIC_NIF_LIBS = $(STATIC_NIFS) +DEPLIBS += $(STATIC_NIF_LIBS) +COMPILE_STATIC_LIBS = yes +else +STATIC_NIF_LIBS= +endif + +ifneq ($(STATIC_DRIVERS),no) +STATIC_DRIVER_LIBS = $(STATIC_DRIVERS) +DEPLIBS += $(STATIC_DRIVER_LIBS) +COMPILE_STATIC_LIBS = yes +else +STATIC_DRIVER_LIBS= endif - DRV_OBJS += $(OBJDIR)/ttsl_drv.o +ifeq ($(COMPILE_STATIC_LIBS),yes) + +$(STATIC_NIF_LIBS) $(STATIC_DRIVER_LIBS): + echo "=== Entering lib to make static libs" + (cd $(ERL_TOP)/lib/ && $(MAKE) BUILD_STATIC_LIBS=1 TYPE=$(TYPE) static_lib) + echo "=== Leaving lib after making static libs" +endif ifeq ($(ERTS_ENABLE_KERNEL_POLL),yes) OS_OBJS += $(OBJDIR)/erl_poll.kp.o \ @@ -938,20 +1020,30 @@ $(OBJDIR)/hipe_arm.o: hipe/hipe_arm.c # ---------------------------------------------------------------------- # The emulator itself +# ifeq ($(TARGET), win32) # Only the basic erlang to begin with eh? $(BINDIR)/$(EMULATOR_EXECUTABLE): $(INIT_OBJS) $(OBJS) $(DEPLIBS) $(ld_verbose)$(PURIFY) $(LD) -dll -def:sys/$(ERLANG_OSTYPE)/erl.def -implib:$(BINDIR)/erl_dll.lib -o $(BINDIR)/$(EMULATOR_EXECUTABLE) \ - $(LDFLAGS) $(DEXPORT) $(INIT_OBJS) $(OBJS) $(LIBS) -else + $(LDFLAGS) $(DEXPORT) $(INIT_OBJS) $(OBJS) $(STATIC_NIF_LIBS) \ + $(STATIC_DRIVER_LIBS) $(LIBS) +else +ifeq ($(findstring ose,$(TARGET)),ose) +$(BINDIR)/$(EMULATOR_EXECUTABLE): $(INIT_OBJS) $(OBJS) $(DEPLIBS) $(LCF) + $(call build-ose-load-module, $@, $(INIT_OBJS) $(OBJS), $(STATIC_NIF_LIBS) \ + $(STATIC_DRIVER_LIBS) $(LIBS), $(LMCONF)) +else $(BINDIR)/$(EMULATOR_EXECUTABLE): $(INIT_OBJS) $(OBJS) $(DEPLIBS) + echo $(DEPLIBS) $(ld_verbose)$(PURIFY) $(LD) -o $(BINDIR)/$(EMULATOR_EXECUTABLE) \ - $(HIPEBEAMLDFLAGS) $(LDFLAGS) $(DEXPORT) $(INIT_OBJS) $(OBJS) $(LIBS) + $(HIPEBEAMLDFLAGS) $(LDFLAGS) $(DEXPORT) $(INIT_OBJS) $(OBJS) \ + $(STATIC_NIF_LIBS) $(STATIC_DRIVER_LIBS) $(LIBS) endif +endif # ---------------------------------------------------------------------- # Dependencies |