~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to erts/emulator/Makefile.in

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
2
2
# %CopyrightBegin%
3
 
4
 
# Copyright Ericsson AB 1996-2009. All Rights Reserved.
5
 
 
3
#
 
4
# Copyright Ericsson AB 1996-2010. All Rights Reserved.
 
5
#
6
6
# The contents of this file are subject to the Erlang Public License,
7
7
# Version 1.1, (the "License"); you may not use this file except in
8
8
# compliance with the License. You should have received a copy of the
9
9
# Erlang Public License along with this software. If not, it can be
10
10
# retrieved online at http://www.erlang.org/.
11
 
 
11
#
12
12
# Software distributed under the License is distributed on an "AS IS"
13
13
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
# the License for the specific language governing rights and limitations
15
15
# under the License.
16
 
 
16
#
17
17
# %CopyrightEnd%
18
18
#
19
19
 
20
20
include $(ERL_TOP)/make/target.mk
21
21
include ../vsn.mk
 
22
include $(ERL_TOP)/make/$(TARGET)/otp.mk
22
23
 
23
24
ENABLE_ALLOC_TYPE_VARS = @ENABLE_ALLOC_TYPE_VARS@
24
25
HIPE_ENABLED=@HIPE_ENABLED@
60
61
PURIFY = quantify $(QUANTIFY_BUILD_OPTIONS)
61
62
TYPEMARKER = .quantify
62
63
ENABLE_ALLOC_TYPE_VARS += quantify
63
 
ifeq ($(findstring ose,$(TARGET)),ose)
64
 
  TYPE_FLAGS = @CFLAGS@ -DQUANTIFY
65
 
else
66
64
  TYPE_FLAGS = @CFLAGS@ -g -O2 -DQUANTIFY -DNO_JUMP_TABLE
67
 
endif
68
65
else
69
66
 
70
67
ifeq ($(TYPE),purecov)
77
74
ifeq ($(TYPE),gcov)
78
75
PURIFY = 
79
76
TYPEMARKER = .gcov
80
 
TYPE_FLAGS = @DEBUG_CFLAGS@ -DNO_JUMP_TABLE -fprofile-arcs -ftest-coverage -O0 -DERTS_CAN_INLINE=0 -DERTS_INLINE=
 
77
TYPE_FLAGS = @DEBUG_CFLAGS@ -DERTS_GCOV -DNO_JUMP_TABLE -fprofile-arcs -ftest-coverage -O0 -DERTS_CAN_INLINE=0 -DERTS_INLINE=
81
78
ifneq ($(findstring solaris,$(TARGET)),solaris)
82
79
LIBS += -lgcov
83
80
endif
166
163
ppcBEAMLDFLAGS=-Wl,-m,elf32ppc
167
164
ppc64BEAMLDFLAGS=-Wl,-m,elf64ppc,-T,hipe/elf64ppc.x
168
165
endif
 
166
ifeq ($(OPSYS),darwin)
 
167
amd64BEAMLDFLAGS=-pagezero_size 0x10000000
 
168
endif
169
169
HIPEBEAMLDFLAGS=$($(ARCH)BEAMLDFLAGS)
170
170
endif
171
171
 
199
199
 
200
200
USING_MINGW=@MIXED_CYGWIN_MINGW@
201
201
 
 
202
ifeq ($(TARGET),win32)
 
203
LIB_PREFIX=
 
204
LIB_SUFFIX=.lib
 
205
else
 
206
LIB_PREFIX=lib
 
207
LIB_SUFFIX=.a
 
208
endif
 
209
 
202
210
OMIT_OMIT_FP=no
203
211
 
204
212
ifeq (@EMU_LOCK_CHECKING@,yes)
213
221
OPT_LEVEL = -O3
214
222
endif
215
223
 
216
 
ifeq ($(CC), gcc)
 
224
ifeq ($(GCC),yes)
217
225
ifeq ($(NO_INLINE_FUNCTIONS),true)
218
226
GEN_OPT_FLGS = $(OPT_LEVEL) -fno-inline-functions
219
227
else
252
260
                $(subst PURIFY,FAKE_PURIFY, $(TYPE_FLAGS)))
253
261
endif
254
262
CS_CFLAGS_ = $(CS_TYPE_FLAGS) @DEFS@ $(WFLAGS) 
255
 
ifeq ($(CC), gcc)
 
263
ifeq ($(GCC),yes)
256
264
CS_CFLAGS = $(subst -O2, $(GEN_OPT_FLGS) $(UNROLL_FLG), $(CS_CFLAGS_))
257
265
else
258
266
CS_CFLAGS = $(CS_CFLAGS_)
279
287
 
280
288
ifeq ($(TARGET),win32)
281
289
LIBS    += -L$(ERL_TOP)/erts/emulator/pcre/obj/$(TARGET)/$(TYPE) -lepcre
282
 
DEPLIBS += $(ERL_TOP)/erts/emulator/pcre/obj/$(TARGET)/$(TYPE)/epcre.lib
283
290
else
284
 
LIBS    += $(ERL_TOP)/erts/emulator/pcre/obj/$(TARGET)/$(TYPE)/libepcre.a
285
 
DEPLIBS += \
286
 
        $(ERL_TOP)/erts/emulator/pcre/obj/$(TARGET)/$(TYPE)/libepcre.a \
287
 
        $(ERL_TOP)/erts/lib/internal/$(TARGET)/liberts_internal.a 
288
 
# rem liberts_internal.a
 
291
LIBS    += $(ERL_TOP)/erts/emulator/pcre/obj/$(TARGET)/$(TYPE)/$(LIB_PREFIX)epcre$(LIB_SUFFIX)
289
292
endif
290
293
 
291
 
ELIB_FLAGS = -DENABLE_ELIB_MALLOC -DELIB_ALLOC_IS_CLIB -DELIB_HEAP_SBRK
 
294
DEPLIBS += $(ERL_TOP)/erts/emulator/pcre/obj/$(TARGET)/$(TYPE)/$(LIB_PREFIX)epcre$(LIB_SUFFIX)
292
295
 
293
296
PERFCTR_PATH=@PERFCTR_PATH@
294
297
USE_PERFCTR=@USE_PERFCTR@
305
308
ORG_THR_LIBS=@EMU_THR_LIBS@
306
309
THR_LIB_NAME=@EMU_THR_LIB_NAME@
307
310
 
308
 
THR_LIBS=$(subst -l$(THR_LIB_NAME),-l$(THR_LIB_NAME)$(TYPEMARKER),$(ORG_THR_LIBS))
 
311
ifneq ($(strip $(THR_LIB_NAME)),)
 
312
DEPLIBS +=      $(ERL_TOP)/erts/lib/internal/$(TARGET)/$(LIB_PREFIX)erts_internal_r$(TYPEMARKER)$(LIB_SUFFIX) \
 
313
                $(ERL_TOP)/erts/lib/internal/$(TARGET)/$(LIB_PREFIX)ethread$(TYPEMARKER)$(LIB_SUFFIX)
 
314
else
 
315
DEPLIBS +=      $(ERL_TOP)/erts/lib/internal/$(TARGET)/$(LIB_PREFIX)erts_internal$(TYPEMARKER)$(LIB_SUFFIX)
 
316
endif
 
317
 
 
318
THR_LIBS=$(subst -l$(THR_LIB_NAME),-l$(THR_LIB_NAME)$(TYPEMARKER), \
 
319
           $(subst -lerts_internal_r,-lerts_internal_r$(TYPEMARKER),$(ORG_THR_LIBS)))
 
320
 
 
321
LIBS += $(THR_LIBS)
 
322
 
 
323
ifneq ($(findstring erts_internal_r, $(THR_LIBS)),erts_internal_r)
309
324
 
310
325
ifeq ($(findstring vxworks,$(TARGET)),vxworks)
311
326
ERTS_INTERNAL_LIB=erts_internal
317
332
endif
318
333
endif
319
334
 
320
 
LIBS += $(THR_LIBS) -l$(ERTS_INTERNAL_LIB)$(TYPEMARKER)
 
335
LIBS += -l$(ERTS_INTERNAL_LIB)$(TYPEMARKER)
 
336
 
 
337
endif # erts_internal_r
321
338
 
322
339
LIBS += @LIBRT@
323
340
 
341
358
 
342
359
ENABLE_ALLOC_TYPE_VARS += @ERLANG_OSTYPE@
343
360
 
344
 
EMULATOR_EXECUTABLE_SAE = beam_evm$(TF_MARKER)
345
361
EMULATOR_EXECUTABLE_ELIB = beam.elib$(TF_MARKER)
346
362
ifeq ($(TARGET), win32)
347
363
EMULATOR_EXECUTABLE = beam$(TF_MARKER).dll
351
367
CS_EXECUTABLE = child_setup$(TYPEMARKER)
352
368
 
353
369
# ----------------------------------------------------------------------
354
 
include $(ERL_TOP)/make/$(TARGET)/otp.mk
355
370
 
356
371
ifeq ($(ERLANG_OSTYPE), unix)
357
372
UNIX_ONLY_BUILDS =      $(BINDIR)/$(CS_EXECUTABLE)
402
417
        $(RM) -f $(TARGET)/*/*/*.c $(TARGET)/*/*/*.h $(TARGET)/*/*/*.S
403
418
        $(RM) -f $(ERL_TOP)/erts/emulator/obj/$(TARGET)/*/*/*.o
404
419
        $(RM) -f $(BINDIR)/beam $(BINDIR)/beam.*
405
 
        $(RM) -f $(BINDIR)/child_setup $(BINDIR)/child_setup.*
 
420
        $(RM) -rf $(BINDIR)/child_setup $(BINDIR)/child_setup.*
406
421
        $(RM) -f $(BINDIR)/hipe_mkliterals $(BINDIR)/hipe_mkliterals.*
407
422
        @set -e ; cd zlib && $(MAKE) clean
408
423
        @set -e ; cd pcre && $(MAKE) clean
409
424
 
410
 
.PHONY: all sae zlib pcre clean
 
425
.PHONY: all zlib pcre clean
411
426
 
412
427
docs:
413
428
 
416
431
 
417
432
RELSYSDIR = $(RELEASE_PATH)/erts-$(VSN)
418
433
 
419
 
RELEASE_INCLUDES = beam/erl_driver.h sys/$(ERLANG_OSTYPE)/driver_int.h beam/erl_nif.h beam/erl_nif_api_funcs.h
 
434
RELEASE_INCLUDES = beam/erl_driver.h sys/$(ERLANG_OSTYPE)/driver_int.h beam/erl_nif.h beam/erl_nif_api_funcs.h beam/erl_drv_nif.h
420
435
ifeq ($(TARGET),win32)
421
436
RELEASE_INCLUDES += sys/$(ERLANG_OSTYPE)/erl_win_dyn_driver.h
422
437
endif
423
 
ifeq ($(findstring ose,$(TARGET)),ose)
424
 
RELEASE_INCLUDES += sys/$(ERLANG_OSTYPE)/erl_port_signals.sig \
425
 
                    sys/$(ERLANG_OSTYPE)/ose_erl_port_prog.h  \
426
 
                    drivers/$(ERLANG_OSTYPE)/ose_erl_driver.h
427
 
 
428
 
endif
429
438
 
430
439
ifeq ($(TYPE)-@HAVE_VALGRIND@,valgrind-no)
431
440
release_spec:
449
458
ifeq ($(ERLANG_OSTYPE), unix)
450
459
        $(INSTALL_PROGRAM) $(BINDIR)/$(CS_EXECUTABLE) $(RELSYSDIR)/bin
451
460
endif
452
 
        $(INSTALL_DIR) $(RELEASE_PATH)/usr/include/obsolete
453
 
        $(INSTALL_DATA) obsolete/driver.h $(RELEASE_PATH)/usr/include/obsolete
454
461
endif
455
462
endif
456
463
 
477
484
 
478
485
ifeq ($(findstring vxworks,$(TARGET)),vxworks)
479
486
else
480
 
ifeq ($(findstring ose,$(TARGET)),ose)
481
 
else
482
487
ifdef HIPE_ENABLED
483
488
GENERATE +=     $(TTF_DIR)/hipe_x86_asm.h \
484
489
                $(TTF_DIR)/hipe_amd64_asm.h \
489
494
                $(BINDIR)/hipe_mkliterals$(TF_MARKER)
490
495
endif
491
496
endif
492
 
endif
493
497
 
494
498
ifeq ($(FLAVOR)-@ERTS_BUILD_SMP_EMU@,smp-no)
495
499
GENERATE=
501
505
OPCODE_TABLES += hipe/hipe_ops.tab
502
506
endif
503
507
 
504
 
$(TTF_DIR)/beam_opcodes.h $(TTF_DIR)/beam_opcodes.c: $(OPCODE_TABLES)
505
 
        LANG=C $(PERL) utils/beam_makeops -outdir $(TTF_DIR) \
 
508
$(TTF_DIR)/beam_opcodes.h $(TTF_DIR)/beam_opcodes.c: $(OPCODE_TABLES) utils/beam_makeops
 
509
        LANG=C $(PERL) utils/beam_makeops \
 
510
                -wordsize @EXTERNAL_WORD_SIZE@ \
 
511
                -outdir $(TTF_DIR) \
506
512
                -emulator $(OPCODE_TABLES)
507
513
 
508
514
# bif and atom table
527
533
        $(TARGET)/erl_atom_table.c $(TARGET)/erl_atom_table.h   \
528
534
        $(TARGET)/erl_pbifs.c
529
535
 
530
 
$(TABLES):      $(ATOMS) $(BIFS)
531
 
        LANG=C $(PERL) utils/make_tables -src $(TARGET) -include $(TARGET) $^
 
536
$(TABLES): $(ATOMS) $(BIFS) utils/make_tables
 
537
        LANG=C $(PERL) utils/make_tables -src $(TARGET) -include $(TARGET)\
 
538
                $(ATOMS) $(BIFS)
532
539
 
533
540
$(TTF_DIR)/erl_alloc_types.h: beam/erl_alloc.types utils/make_alloc_types
534
541
        LANG=C $(PERL) utils/make_alloc_types -src $< -dst $@ $(ENABLE_ALLOC_TYPE_VARS)
589
596
INCLUDES += -I$(ERL_TOP)/erts/etc/vxworks
590
597
endif
591
598
 
592
 
ifneq ($(findstring ose,$(TARGET)),ose)
593
599
ifeq ($(TARGET),win32)
594
600
# Usually the same as the default rule, but certain platforms (i.e. win32) mix
595
601
# different compilers
606
612
 
607
613
ifneq ($(filter tile-%,$(TARGET)),)
608
614
$(OBJDIR)/beam_emu.o: beam/beam_emu.c
609
 
       $(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) \
 
615
        $(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) \
610
616
         -OPT:Olimit=0 -WOPT:lpre=off:spre=off:epre=off \
611
617
         $(INCLUDES) -c $< -o $@
612
618
endif
615
621
$(OBJDIR)/%.o: beam/%.c
616
622
        $(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
617
623
 
618
 
else
619
 
 
620
 
INCLUDES += -Idrivers/ose
621
 
 
622
 
ifeq ($(TYPE),debug)
623
 
$(OBJDIR)/%.o: beam/%.c
624
 
          $(CC) $(CFLAGS) -DNO_JUMP_TABLE $(INCLUDES) -c $< -o $@
625
 
else
626
 
 
627
 
VXCC=@VXCC@
628
 
VXCFLAGS=@VXCFLAGS@
629
 
CFLAGS_NOOPT=@CFLAGS_NOOPT@ @DEFS@ $(WFLAGS) $(THR_DEFS) $(ARCHCFLAGS)
630
 
 
631
 
# we want to use jump table
632
 
$(OBJDIR)/beam_emu.o: beam/beam_emu.c
633
 
        $(VXCC) $(VXCFLAGS) $(INCLUDES) -c $< -o $@
634
 
 
635
 
# erl_process does not work properly with DIAB's -XO option,
636
 
# we'll compile it with gcc instead
637
 
$(OBJDIR)/erl_process.o: beam/erl_process.c
638
 
        $(VXCC) $(VXCFLAGS) $(INCLUDES) -c $< -o $@
639
 
 
640
 
$(OBJDIR)/%.o: beam/%.c
641
 
        $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
642
 
endif
643
 
endif
644
 
 
645
624
$(OBJDIR)/%.o: $(TARGET)/%.c
646
625
        $(CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -c $< -o $@
647
626
 
660
639
$(OBJDIR)/%.o: drivers/$(ERLANG_OSTYPE)/%.c
661
640
        $(CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -Idrivers/$(ERLANG_OSTYPE) -I../etc/$(ERLANG_OSTYPE) -c $< -o $@
662
641
 
663
 
# VxWorks and OSE uses unix drivers too...
 
642
# VxWorks uses unix drivers too...
664
643
ifeq ($(findstring vxworks,$(TARGET)),vxworks)
665
644
$(OBJDIR)/%.o: drivers/unix/%.c
666
645
        $(CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -c $< -o $@
667
646
endif
668
 
ifeq ($(findstring ose,$(TARGET)),ose)
669
 
$(OBJDIR)/%.o: drivers/unix/%.c
670
 
        $(CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -c $< -o $@
671
 
endif
672
647
 
673
648
# ----------------------------------------------------------------------
674
649
# Specials
679
654
        $(CS_PURIFY) $(CC) $(CS_LDFLAGS) -o $(BINDIR)/$(CS_EXECUTABLE) \
680
655
               $(CS_CFLAGS) $(COMMON_INCLUDES) $(CS_SRC) $(CS_LIBS)
681
656
 
682
 
$(OBJDIR)/%.elib.o: beam/%.c
683
 
        $(CC) $(ELIB_FLAGS) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
684
 
 
685
 
# Disable vfork() for sae (then we don't need the child_setup program)
686
 
$(OBJDIR)/sys_sae.o: sys/$(ERLANG_OSTYPE)/sys.c
687
 
        $(CC) -DDISABLE_VFORK=1 $(CFLAGS) $(INCLUDES) -c $< -o $@
688
 
 
689
657
$(OBJDIR)/%.kp.o: sys/common/%.c
690
658
        $(CC) -DERTS_KERNEL_POLL_VERSION $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
691
659
 
692
660
$(OBJDIR)/%.nkp.o: sys/common/%.c
693
661
        $(CC) -DERTS_NO_KERNEL_POLL_VERSION $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
694
662
 
695
 
ifeq ($(CC), gcc)
696
 
 
697
 
$(OBJDIR)/erl_obsolete.o: beam/erl_obsolete.c
698
 
        $(CC) $(subst -Wstrict-prototypes, , $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS))) $(INCLUDES) -c $< -o $@
 
663
ifeq ($(GCC),yes)
699
664
 
700
665
$(OBJDIR)/erl_goodfit_alloc.o: beam/erl_goodfit_alloc.c
701
666
        $(CC) $(subst -O2, $(GEN_OPT_FLGS) $(UNROLL_FLG), $(CFLAGS)) $(INCLUDES) -c $< -o $@
731
696
 
732
697
INIT_OBJS = $(OBJDIR)/erl_main.o                $(PRELOAD)
733
698
 
734
 
INIT_OBJS_SAE = $(OBJDIR)/erl9_start.o
735
 
 
736
699
EMU_OBJS = \
737
700
        $(OBJDIR)/beam_emu.o            $(OBJDIR)/beam_opcodes.o \
738
701
        $(OBJDIR)/beam_load.o           $(OBJDIR)/beam_bif_load.o \
773
736
        $(OBJDIR)/erl_fun.o             $(OBJDIR)/erl_bif_port.o \
774
737
        $(OBJDIR)/erl_term.o            $(OBJDIR)/erl_node_tables.o \
775
738
        $(OBJDIR)/erl_monitors.o        $(OBJDIR)/erl_process_dump.o \
776
 
        $(OBJDIR)/erl_obsolete.o        $(OBJDIR)/erl_bif_timer.o \
 
739
        $(OBJDIR)/erl_bif_timer.o       $(OBJDIR)/erl_cpu_topology.o \
777
740
        $(OBJDIR)/erl_drv_thread.o      $(OBJDIR)/erl_bif_chksum.o \
778
741
        $(OBJDIR)/erl_bif_re.o          $(OBJDIR)/erl_unicode.o \
779
742
        $(OBJDIR)/packet_parser.o       $(OBJDIR)/safe_hash.o \
780
 
        $(OBJDIR)/erl_zlib.o            $(OBJDIR)/erl_nif.o
 
743
        $(OBJDIR)/erl_zlib.o            $(OBJDIR)/erl_nif.o \
 
744
        $(OBJDIR)/erl_bif_binary.o
781
745
 
782
746
ifeq ($(TARGET),win32)
783
747
DRV_OBJS = \
796
760
        $(OBJDIR)/sys_time.o \
797
761
        $(OBJDIR)/sys_interrupt.o \
798
762
        $(OBJDIR)/sys_env.o \
799
 
        $(OBJDIR)/dosmap.o \
800
 
        $(OBJDIR)/elib_malloc.o
 
763
        $(OBJDIR)/dosmap.o
801
764
else
802
765
OS_OBJS = \
803
766
        $(OBJDIR)/sys.o \
804
767
        $(OBJDIR)/driver_tab.o \
805
768
        $(OBJDIR)/unix_efile.o \
806
769
        $(OBJDIR)/gzio.o \
807
 
        $(OBJDIR)/elib_malloc.o \
808
770
        $(OBJDIR)/elib_memmove.o
809
771
 
810
 
ifeq ($(findstring ose,$(TARGET)),ose)
811
 
        OS_OBJS += $(OBJDIR)/erl_port_init.o \
812
 
                   $(OBJDIR)/ose_inet_sock_select.o \
813
 
                   $(OBJDIR)/ose_sfp.o
814
 
else
815
772
ifeq ($(findstring vxworks,$(TARGET)),vxworks)
816
773
        OS_OBJS += $(OBJDIR)/int64.o 
817
774
else
818
775
        OS_OBJS += $(OBJDIR)/sys_float.o \
819
776
                   $(OBJDIR)/sys_time.o
820
777
endif
821
 
endif
822
778
DRV_OBJS = \
823
779
        $(OBJDIR)/efile_drv.o \
824
780
        $(OBJDIR)/inet_drv.o \
827
783
endif
828
784
 
829
785
ifneq ($(findstring vxworks,$(TARGET)),vxworks)
830
 
  ifeq ($(findstring ose,$(TARGET)),ose)
831
 
        DRV_OBJS += $(OBJDIR)/ose_inet_drv.o
832
 
  else
833
786
        DRV_OBJS += $(OBJDIR)/ttsl_drv.o
834
 
  endif
835
787
endif
836
788
 
837
789
ifeq ($(ERTS_ENABLE_KERNEL_POLL),yes)
846
798
 
847
799
OS_OBJS +=      $(OBJDIR)/erl_mseg.o \
848
800
                $(OBJDIR)/erl_$(ERLANG_OSTYPE)_sys_ddll.o \
849
 
                $(OBJDIR)/erl_mtrace_sys_wrap.o
 
801
                $(OBJDIR)/erl_mtrace_sys_wrap.o \
 
802
                $(OBJDIR)/erl_sys_common_misc.o
850
803
 
851
804
HIPE_x86_OS_OBJS=$(HIPE_x86_$(OPSYS)_OBJS)
852
805
HIPE_x86_OBJS=$(OBJDIR)/hipe_x86.o $(OBJDIR)/hipe_x86_glue.o $(OBJDIR)/hipe_x86_bifs.o $(OBJDIR)/hipe_x86_signal.o $(OBJDIR)/hipe_x86_stack.o $(HIPE_x86_OS_OBJS)
877
830
BASE_OBJS = $(RUN_OBJS) $(EMU_OBJS) $(OS_OBJS) $(EXTRA_BASE_OBJS)
878
831
 
879
832
OBJS =  $(BASE_OBJS) $(DRV_OBJS)
880
 
OBJS_SAE =  $(subst sys.o,sys_sae.o,$(OBJS))
881
 
 
882
 
ELIB_C_FILES =  beam/elib_malloc.c \
883
 
                beam/elib_memmove.c \
884
 
                beam/erl_bif_info.c \
885
 
                beam/utils.c \
886
 
                beam/erl_alloc.c
887
 
 
888
 
MOD_OBJS_ELIB = $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(ELIB_C_FILES)))
889
 
OBJS_ELIB =     $(patsubst %.o,%.elib.o,$(MOD_OBJS_ELIB)) \
890
 
                $(filter-out $(MOD_OBJS_ELIB),$(OBJS))
891
833
 
892
834
########################################
893
835
# HiPE section
965
907
 
966
908
endif
967
909
 
968
 
ifeq ($(findstring ose,$(TARGET)),ose)
969
 
# Extract soft float functions from libgcc.a (for beam_emu)
970
 
VXCC=@VXCC@
971
 
VXCFLAGS=@VXCFLAGS@
972
 
VXLD=@VXLD@
973
 
VXLDFLAGS=@VXLDFLAGS@
974
 
VXCCLIBFLAGS=@VXCCLIBFLAGS@
975
 
STRIP=@STRIP@
976
 
SYMPREFIX=@SYMPREFIX@
977
 
 
978
 
NEEDFUNCTIONS=__floatsidf __adddf3 __negdf2 __muldf3 __divdf3 __subdf3
979
 
KEEPSYMS=$(NEEDFUNCTIONS:%=-K $(SYMPREFIX)%)
980
 
 
981
 
$(OBJDIR)/ose_sfp.o: $(TARGET)/ose_sfp.c
982
 
        $(VXCC) $(VXCFLAGS) -o $(OBJDIR)/ose_sfp_tmp.o -c $(TARGET)/ose_sfp.c
983
 
        $(VXLD) -o $(OBJDIR)/ose_sfp.o $(OBJDIR)/ose_sfp_tmp.o $(VXLDFLAGS) $(VXCCLIBFLAGS)
984
 
        $(STRIP) $(KEEPSYMS) $(OBJDIR)/ose_sfp.o
985
 
 
986
 
$(TARGET)/ose_sfp.c:
987
 
        echo 'void dummy(void); void dummy(void) {' > $(TARGET)/ose_sfp.c
988
 
        for x in $(NEEDFUNCTIONS); do echo 'extern void '$$x'();' \
989
 
                >> $(TARGET)/ose_sfp.c; done 
990
 
        for x in $(NEEDFUNCTIONS); do echo $$x'();' >> $(TARGET)/ose_sfp.c; done
991
 
        echo '}'  >> $(TARGET)/ose_sfp.c 
992
 
 
993
 
endif
994
 
 
995
910
# ----------------------------------------------------------------------
996
911
# The emulator itself
997
912
 
1007
922
        $(PURIFY) $(LD) -o $(BINDIR)/$(EMULATOR_EXECUTABLE) \
1008
923
        $(HIPEBEAMLDFLAGS) $(LDFLAGS) $(DEXPORT) $(INIT_OBJS) $(OBJS) $(LIBS)
1009
924
 
1010
 
$(BINDIR)/$(EMULATOR_EXECUTABLE_ELIB): $(INIT_OBJS) $(OBJS_ELIB) $(DEPLIBS)
1011
 
        $(PURIFY) $(LD) -o $(BINDIR)/$(EMULATOR_EXECUTABLE_ELIB) \
1012
 
        $(LDFLAGS) $(DEXPORT) $(INIT_OBJS) $(OBJS_ELIB) $(LIBS)
1013
 
 
1014
 
$(BINDIR)/$(EMULATOR_EXECUTABLE_SAE): $(INIT_OBJS_SAE) $(OBJS_SAE) $(DEPLIBS)
1015
 
        $(PURIFY) $(LD) -o $(BINDIR)/$(EMULATOR_EXECUTABLE_SAE) \
1016
 
        $(LDFLAGS) $(DEXPORT) $(INIT_OBJS_SAE) $(OBJS_SAE) $(LIBS)
1017
 
 
1018
925
endif
1019
926
 
1020
927
#
1086
993
# SYS_SRC=$(subst sys/common/erl_poll.c,,$(ALL_SYS_SRC))
1087
994
 
1088
995
else # !win32
 
996
 
 
997
ifeq ($(findstring tile,$(TARGET)),tile)
 
998
# tile-gcc doesn't like -MG
 
999
MG_FLAG=
 
1000
else
 
1001
MG_FLAG=-MG
 
1002
endif
 
1003
 
1089
1004
DEP_CC=$(CC)
1090
 
DEP_FLAGS=-MM -MG $(CFLAGS) $(INCLUDES) -Idrivers/common
 
1005
DEP_FLAGS=-MM $(MG_FLAG) $(CFLAGS) $(INCLUDES) -Idrivers/common
1091
1006
SYS_SRC=$(ALL_SYS_SRC)
1092
1007
endif
1093
1008
 
1101
1016
        $(DEP_CC) $(DEP_FLAGS) $(TARGET_SRC) \
1102
1017
                | $(SED_DEPEND) >> $(TARGET)/depend.mk
1103
1018
ifneq ($(TARGET),win32)
1104
 
        $(DEP_CC) $(DEP_FLAGS) $(ELIB_FLAGS) $(ELIB_C_FILES) \
 
1019
        $(DEP_CC) $(DEP_FLAGS) $(ELIB_C_FILES) \
1105
1020
                | $(SED_ELIB_DEPEND) >> $(TARGET)/depend.mk
1106
1021
endif
1107
1022
ifdef HIPE_ENABLED