Changeset 156


Ignore:
Timestamp:
May 16, 2003, 9:27:59 AM (22 years ago)
Author:
zap
Message:

o Modified makefiles so that os2.a builds correctly (with Vio, Kbd and friends,

not just from the import files).

o Moved os2.smak to the os2_386 directory (tcp32dll.imp will go into socket.a).
o Added the rules into libc.smak to build libc##.dll (finally it links without

errors! Don't know if it works, though ;-)

o Fixed emxbind so that it doesn't add underscores to exported symbols (taken

from the EXPORTS section of a .def file).

o Fixed emxexp so that it doesn't remove underscores from symbol names.
o Fixed all references to OS/2 functions to not contain an initial underscore

(since they are _System now).

o Added one builder makefile: mkimplib.smak, and two auxiliary submakefiles:

mkomflib.smak (included from both mklib and mkimplib), and a version.smak
that contains the version number, description and copyright for libc.

o Made a lot of small changes in order to remove duplicate symbols in libc.dll.
o Added sys/settime.c which was missing in EMX's -Zomf -Zsys variant.

Location:
trunk/src/emx
Files:
8 added
2 deleted
39 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/Makefile

    • Property cvs2svn:cvs-rev changed from 1.9 to 1.10
    r155 r156  
    77#
    88# Author: Andrew Zabolotny <zap@cobra.ru>
     9# $Id$
    910#
    1011# All Rights Reserved
     
    6768# Linker flags
    6869LDFLAGS = -Zmt $(LDFLAGS.$(MODE)) $(LDFLAGS.KIND)
     70LDFLAGS.DLL = $(LDFLAGS) -Zdll
    6971# Linker flags for different build modes
    7072LDFLAGS.opt = -s
     
    7678LDFLAGS.KIND = $(foreach x,$(subst -, ,$(firstword $(subst /, ,$(subst $.,,$@)))),$(LDFLAGS.$x))
    7779# How to link a .exe file
    78 DO.LINK.exe = $(LD) $(strip $(LDFLAGS) $1) -o $@ $(^O) $(^DEF) $(^LIB)
     80DO.LINK.exe = $(LD) $(strip $(LDFLAGS) $(filter-out -l%,$1)) -o $@ $(^O) $(^LIB) $(filter -l%,$1)
     81# How to link a .dll file
     82DO.LINK.dll = $(LD) $(strip $(LDFLAGS.DLL) $(filter-out -l%,$1)) -o $@ $(^O) $(^DEF) $(^LIB) $(filter -l%,$1)
     83
     84# emxbind tool
     85EMXBIND = $(if $(wildcard $./$(TOOLFMT)/emxbind$E),$.$(TOOLFMT)/)emxbind$E
     86# emxbind flags
     87EMXBINDFLAGS = -q $(EMXBINDFLAGS.$(MODE))
     88EMXBINDFLAGS.opt = -s
     89EMXBINDFLAGS.dbg =
     90# Flags for emxbind
     91DO.EMXBIND = $(EMXBIND) $(EMXBINDFLAGS) -o $@ $1
    7992
    8093# The macro assembler
     
    87100AR = $(if $(findstring .lib,$@),emxomf)ar
    88101ARFLAGS = crs
    89 DO.LIBRARY = $(AR) $(ARFLAGS) $@ $(^O)
     102DO.LIBRARY = $(call RM,$@); $(AR) $(ARFLAGS)$1 $@ $(^O)
     103
     104# The tool to extract exports from object files and archives
     105EMXEXP = $(if $(wildcard $./$(TOOLFMT)/emxexp$E),$.$(TOOLFMT)/)emxexp$E
    90106
    91107# The tool to create import libraries
    92 IMPLIB = $(if $(wildcard $(IMPLIB.BUILT)),$(IMPLIB.BUILT),emximp$E)
    93 IMPLIB.BUILT = $./$(TOOLFMT)/emximp$E
    94 IMPLIBFLAGS.aout.prof = -m
    95 IMPLIBFLAGS.omf =
    96 IMPLIBFLAGS.KIND = $(foreach x, $(subst -, ,$(firstword $(subst /, ,$(subst $.,,$@)))) \
    97   $(subst -,.,$(firstword $(subst /, ,$(subst $.,,$@)))),$(IMPLIBFLAGS.$x))
    98 DO.IMPLIB = $(IMPLIB) $(IMPLIBFLAGS.KIND) -o $@ $1
     108IMPLIB = $(if $(wildcard $./$(TOOLFMT)/emximp$E),$.$(TOOLFMT)/)emximp$E
     109IMPLIBFLAGS.prof = -m
     110IMPLIBFLAGS.KIND = $(foreach x,$(subst -, ,$(firstword $(subst /, ,$(subst $.,,$@)))),$(IMPLIBFLAGS.$x))
     111DO.IMPLIB = $(IMPLIB) -o $@ $(strip $1 $(IMPLIBFLAGS.KIND)) $(^I)\
     112  $(if $(^O),$(NL)$(AR) rs $@ $(^O))
    99113
    100114# How to create dependencies
     
    112126# How to filter just the object files from $^
    113127^O = $(filter %.o,$^)
     128# Just the .imp files from $^
     129^I = $(filter %.imp,$^)
    114130# How to filter just the .def files from $^
    115131^DEF = $(filter %.def,$^)
     
    177193
    178194#------------ Submakefiles ------------
    179 SUBMAK := $(wildcard src/*/*.smak)
     195SUBMAK := version.smak $(wildcard src/*/*.smak)
    180196
    181197# Include all submakefiles
     
    189205help:
    190206        @$(call ECHO,$(SEP))
    191         @$(call ECHO,Welcome to GNU C for OS/2 runtime build system!)
     207        @$(call ECHO,Welcome to $(PACKAGE) build system!)
     208        @$(call ECHO,$(COPYRIGHT))
    192209        @$(call ECHO,To build something, type 'make {target} {vars}', where {target} is one of:)
    193210        @$(call ECHO,    all - build all available modules)
  • trunk/src/emx/build.txt

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    9696
    9797.MDEP - (optional) module dependencies. This is useful if current module
    98   requires another module to be built first (e.g. a library).
     98  requires another module to be built first (e.g. a library). It usually
     99  contains the name of another module (e.g. .MDEP := os2).
    99100
    100101.TARGET - The name of target (e.g. executable or library file name without dir).
  • trunk/src/emx/comend.smak

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r155 r156  
    44# Clear local variables so that we don't incidentally
    55# get a wrong value in a different module
     6ifndef .TKEEP
    67.OBJS :=
    78.DIRS :=
    89.TARG :=
    9 
    10 # Clear all target-specific variables
    11 ifndef .TKEEP
    1210.TARGET :=
    1311.TKIND :=
     
    1614.TCF :=
    1715.TDEP :=
     16.IMPS :=
    1817endif
    1918
  • trunk/src/emx/common.smak

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r155 r156  
    2828.TKIND := $(.tmp)
    2929.TKIND.DIR := $(subst $(SPACE),-,$(.TKIND))/
     30.DIRS :=
    3031
    3132ifdef .TARGET
     
    3334# .TARG is same as .TARGET except that it has a st/ or mt/ prefix
    3435.TARG := $(.TKIND.DIR)$(.TARGET)
     36.DIRS += $.$(.TKIND.DIR)
    3537
    3638ifdef .INSDIR
     
    6163
    6264.OBJS := $(addprefix $.,$(call OBJFILE,$(.TSRC)))
    63 .DIRS := $(sort $(dir $(.OBJS)))
    64 TARGDIRS += $(.DIRS)
     65.DIRS += $(sort $(dir $(.OBJS)))
    6566
    6667# Remove the names of files for which we already generated build rules
     
    9798endif # def .TSRC
    9899
     100# Add target directories to module dependencies and to overall list of dirs
     101ifneq ($(.DIRS),)
     102TARGDIRS += $(.DIRS)
     103ifdef .MODULE
     104$(.MODULE): $(.DIRS)
     105endif # def .MODULE
     106endif # neq ($(.DIRS),)
     107
     108# Add the target to the list of module dependencies
    99109ifdef .TARGET
    100 ifdef .MODULE
    101 $(.MODULE): $(.DIRS) $.$(.TARG)
    102 endif
    103 endif
     110$(.MODULE): $.$(.TARG)
     111endif # def .TARGET
    104112
    105113# Replace the special sequence in .TDEP @O@ with $.$(.TKIND.DIR)
  • trunk/src/emx/include/os2thunk.h

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r155 r156  
    1919#define _THUNK_PASCAL_FLAT(ARG)     _THUNK_PASCAL_LONG (_emx_32to16 (ARG))
    2020#define _THUNK_PASCAL_FAR16(ARG)    _THUNK_PASCAL_LONG (ARG)
    21 #define _THUNK_PASCAL_FUNCTION(FUN) _16_##FUN
     21#define _THUNK_PASCAL_FUNCTION(FUN) APIENTRY _16_##FUN
    2222#define _THUNK_PASCAL_CALL(FUN)     _emx_thunk1 (_tb, (void *)(_16_##FUN)); })
    2323#define _THUNK_PASCAL_CALLI(FUN)    _emx_thunk1 (_tb, (void *)(FUN)); })
  • trunk/src/emx/mklib.smak

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r155 r156  
    1010        $(call FECHO,_@,        $$(DO.LIBRARY))$(NL)
    1111
    12 # The rule for building the OMF variant of library from a.out format
    13 ifneq ($(findstring aout,$(.TKIND)),)
    14 # Remove the .a suffix from library name
    15 .TARGET := $(patsubst %$A,%,$(.TARGET))
    16 # Replace 'aout' with 'omf' in .TKIND
    17 .TKIND := $(subst aout,omf,$(.TKIND))
    18 # Compute the new output file directory
    19 .TKIND.DIR := $(subst $(SPACE),-,$(.TKIND))/
    20 # Append the .lib suffix to target name
    21 .TARGET := $(.TARGET)$A
    22 # Compute the name of target file to build
    23 .TARG@OMF := $(.TKIND.DIR)$(.TARGET)
    24 # The rule for building the xxx@omf variant of target
    25 .PHONY: $(.MODULE)@omf
    26 MODULES += $(.MODULE)@omf
    27 DO.INSTALL += $(call CP,$.$(.TARG@OMF),$(INS)$(.INSDIR)$(.TARGET))$(NL)
    28 .DIRS@OMF := $(dir $.$(.TARG@OMF))
    29 TARGDIRS += $(.DIRS@OMF)
    30 $(.MODULE)@omf: $(.MODULE) $(.DIRS@OMF) $.$(.TARG@OMF)
    31 # bird: Add a dependency rule to help make
    32 RULES += \
    33         $(call FECHO,_@,$.$(.TARG@OMF): $.$(.TARG))$(NL)
    34 endif # neq ($(findstring aout,$(.TKIND)),)
    35 
     12include mkomflib.smak
    3613include comend.smak
  • trunk/src/emx/src/emxbind/emxbind.h

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r155 r156  
    488488
    489489void build_sym_hash_table (void);
    490 struct nlist *find_symbol (const char *name, int underscore);
     490struct nlist *find_symbol (const char *name);
    491491void sort_fixup (void);
    492492void create_fixup (const struct fixup *fp, int neg);
  • trunk/src/emx/src/emxbind/emxbind.smak

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r155 r156  
    88.TSRC   := $(wildcard src/emxbind/*.c)
    99.TLDF   := -lmoddef
     10.TKEEP  := 1
    1011include mkexe.smak
     12
     13.TARG := $(TOOLFMT)/os2stub.bin
     14DO.INSTALL += $(call CP,$.$(.TARG),$(INS)$(.INSDIR))$(NL)
     15
     16emxbind: $.$(.TARG)
     17
     18$.$(.TARG): src/emxbind/os2stub.bin
     19        $(call CP,$< $@)
     20
     21include comend.smak
  • trunk/src/emx/src/emxbind/export.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    8585  put_grow (table, &ord16, 2);
    8686}
    87 
    88 #if 0
    89 
    90 /* Find the symbol NAME in the a.out symbol table of the input
    91    executable.  If UNDERSCORE is true, an underscore is prepended to
    92    NAME.  If the symbol is found, find_symbol() returns a pointer to
    93    the symbol table entry.  Otherwise, NULL is returned. */
    94 
    95 static struct nlist *find_symbol (const char *name, int underscore)
    96 {
    97   int i, j, n, len, ok, t;
    98   const byte *s;
    99 
    100   i = 4; len = strlen (name);
    101   while (i < a_in_str_size)
    102     {
    103       ok = TRUE; s = name;
    104       if (underscore)
    105         {
    106           if (str_image[i] == '_')
    107             ++i;
    108           else
    109             ok = FALSE;
    110         }
    111       if (ok && memcmp (name, str_image+i, len+1) == 0)
    112         {
    113           n = a_in_h.sym_size / sizeof (struct nlist);
    114           if (underscore) --i;
    115           for (j = 0; j < n; ++j)
    116             if (sym_image[j].string == i)
    117               {
    118                 t = sym_image[j].type & ~N_EXT;
    119                 if (t == N_TEXT || t == N_DATA || t == N_BSS)
    120                   return sym_image+j;
    121               }
    122         }
    123       i += strlen (str_image+i) + 1;
    124     }
    125   return NULL;
    126 }
    127 
    128 #endif
    12987
    13088/* Compare two entries of an int array for qsort().  This function is
     
    190148  for (i = 0; i < export_len; ++i)
    191149    {
    192       nl = find_symbol (export_data[i].internalname, TRUE);
     150      nl = find_symbol (export_data[i].internalname);
    193151      if (nl == NULL)
    194152        error ("symbol %s undefined (EXPORTS)", export_data[i].internalname);
  • trunk/src/emx/src/emxbind/fixup.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r155 r156  
    9898
    9999
    100 /* Find the symbol NAME in the a.out symbol table of the input
    101    executable.  If UNDERSCORE is true, an underscore is prepended to
    102    NAME.  If the symbol is found, find_symbol() returns a pointer to
    103    the symbol table entry.  Otherwise, NULL is returned. */
    104 
    105 struct nlist *find_symbol (const char *name, int underscore)
     100/* Find the symbol NAME in the a.out symbol table of the input executable.
     101   If the symbol is found, find_symbol() returns a pointer to the symbol
     102   table entry.  Otherwise, NULL is returned. */
     103
     104struct nlist *find_symbol (const char *name)
    106105{
    107106  int j, len;
     
    109108
    110109  len = strlen (name);
    111   if (underscore)
    112   {
    113     name1 = alloca (len + 2);
    114     ((char *)name1)[0] = '_';
    115     memcpy (((char *)name1) + 1, name, len + 1);
    116   }
    117110
    118111  for (j = sym_hash_table[sym_hash (name1)]; j != -1;
     
    499492    }
    500493  mod_idx = find_module (mod, NO_ADDR);
    501   if (memcmp ("__16_", name1, 5) == 0)
     494  if (memcmp ("_16_", name1, 4) == 0)
    502495    {
    503496      if (r->pcrel)
  • trunk/src/emx/src/emxbind/map.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    160160{
    161161  int i;
    162 
    163   if (*sym_name == '_') ++sym_name;
    164162
    165163  /* TODO: Use hashing. */
     
    218216              grow_map_sym_table ();
    219217              name = sym_image[i].string + str_image;
    220               if (*name == '_') ++name;
    221218              map_sym_table[map_sym_count].seg = seg;
    222219              map_sym_table[map_sym_count].addr = addr;
  • trunk/src/emx/src/emxexp/emxexp.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r155 r156  
    206206      {
    207207        name = str_ptr + sym_ptr[i].string;
    208         if (*name == '_')
    209           ++name;
    210208        export (name);
    211209      }
     
    215213      {
    216214        name = str_ptr + sym_ptr[i].string;
    217         if (*name == '_')
    218           ++name;
    219215        export_bss (name);
    220216      }
  • trunk/src/emx/src/emxload/emxload.smak

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r155 r156  
    11.MODULE := emxload
    22.MDESC  := Fast loader daemon
     3.MDEP   := os2
    34.INSDIR := bin/
    45
     
    67.TKIND  := $(TOOLFMT)
    78.TSRC   := $(wildcard src/emxload/*.c)
    8 .TLDF   :=
     9.TDEP   := @O@os2$A
    910include mkexe.smak
  • trunk/src/emx/src/emxomf/emxomf.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r155 r156  
    10831083        name = str_ptr + sym_ptr[i].string;
    10841084        sym_more[i].index = sym_index++;
    1085         if (memcmp (name, "__16_", 5) == 0)
     1085        if (memcmp (name, "_16_", 4) == 0)
    10861086          sym_more[i].flags |= SF_FAR16;
    10871087        add_extdef (&started, name);
     
    13341334        name = str_ptr + sym_ptr[i].string;
    13351335        sym_more[i].index = sym_index++;
    1336         if (memcmp (name, "__16_", 5) == 0)
     1336        if (memcmp (name, "_16_", 4) == 0)
    13371337          sym_more[i].flags |= SF_FAR16;
    13381338        size = sym_ptr[i].value;
  • trunk/src/emx/src/emxomf/emxomf.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    22.MDESC  := a.out to OMF object file conversion utility
    33.INSDIR := bin/
    4 .MDEP   := omflib@omf moddef@omf
     4.MDEP   := omflib@omf moddef@omf os2
    55
    66.TARGET := emxomf.exe
     
    1919.TKIND  := $(TOOLFMT)
    2020.TSRC   := src/emxomf/emxomfld.c
    21 .TDEP   := @O@moddef$A
     21.TDEP   := @O@moddef$A @O@os2$A
    2222include mkexe.smak
    2323
  • trunk/src/emx/src/ld/ld.c

    • Property cvs2svn:cvs-rev changed from 1.5 to 1.6
    r155 r156  
    8282
    8383#define FIXSETBUG
    84 #ifdef _System
    85 extern int _System DosCopy (char *, char *, int);
    86 #else
    87 extern int DosCopy (char *, char *, int);
    88 #endif
     84/* gcc will warn on __attribute__((system)) but still will compile */
     85extern int __attribute__((system)) DosCopy (char *, char *, int);
    8986#endif /* EMX */
    9087
  • trunk/src/emx/src/ld/ld.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    33.MODULE := ld
    44.MDESC  := Old GNU ld, used for a.out linking
     5.MDEP   := os2
    56.INSDIR := bin/
    67
     
    910.TSRC   := $(wildcard src/ld/*.c)
    1011.TCF    := -DEMX
     12.TDEP   := @O@os2$A
    1113.TLDF   := -liberty
    1214include mkexe.smak
  • trunk/src/emx/src/lib/alias/alias.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    88.MODULE := alias
    99.MDESC  := A library of underscored aliases for most C library functions
    10 .MDEP   := libc sys app
     10.MDEP   := libc app
    1111.TKIND  := aout
    1212.INSDIR := lib/
    13 .TARGET := c_alias$A
     13.TARGET := c_alias.a
    1414include common.smak
    1515
     
    2525# For every aliased function create a .o file containing the alias
    2626# and add it to the target library.
    27 $.$(.TARG): $.$(.TKIND.DIR)c.a $.$(.TKIND.DIR)sys.a $.$(.TKIND.DIR)c_app.a
     27$.$(.TARG): $.$(.TKIND.DIR)c.a $.$(.TKIND.DIR)c_app.a
    2828        $(call RM,$@)
    2929        @$(foreach x,$(ALIAS.FUNCS),\
  • trunk/src/emx/src/lib/alias/aliasfuncs.awk

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    11#
    2 # A simple script to collect all symbols from c.a and sys.a that needs
     2# A simple script to collect all symbols from c.a and c_app.a that needs
    33# aliasing. All symbols beginning with _std_ get an alias without _std_
    44# and an alias starting with just a '_' instead of _std_.
     
    3636BEGIN {
    3737  gulp("out/dbg/aout/c.a");
    38   gulp("out/dbg/aout/sys.a");
    3938  gulp("out/dbg/aout/c_app.a");
    4039
  • trunk/src/emx/src/lib/app/app.smak

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r155 r156  
    66
    77.TKIND  := aout
    8 .TARGET := c_app$A
    9 .TSRC.386 := $(wildcard src/lib/app/386/*.s)
     8.TARGET := c_app.a
     9.TSRC.386 := src/lib/app/386/crt2.s
    1010.TSRC   := $(.TSRC.$(CPU)) $(wildcard src/lib/app/*.c)
    1111.TCF.src/lib/app/stdio.c := -D_NFILES=40
     
    1515include mklib.smak
    1616
     17# Save the list of object files to link them later into libc.dll
     18LIBC.DLL.OBJS += $(.OBJS)
     19
    1720.TKIND  := aout prof
    18 .TARGET := c_app_p$A
     21.TARGET := c_app_p.a
    1922include mklib.smak
  • trunk/src/emx/src/lib/app/stdio.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r155 r156  
    125125void _exit_streams (void)
    126126{
    127   _flushall ();
     127  flushall ();
    128128  _rmtmp ();
    129129}
  • trunk/src/emx/src/lib/end/end.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    22.MDESC  := The C runtime library that should be linked last
    33
     4.TARGET := end.lib
    45.TKIND  := omf
    5 .TARGET := end$A
    66.TSRC.386 := $(wildcard src/lib/end/386/*.asm)
    77.TSRC   := $(.TSRC.$(CPU))
  • trunk/src/emx/src/lib/io/io.smak

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r155 r156  
    1818include comend.smak
    1919
    20 # bird: added dependency to help make make omf version.
     20# Additional dependency to help make make omf version.
    2121$.omf/src/lib/io/386/binmode.obj: $.aout/src/lib/io/386/binmode.o
  • trunk/src/emx/src/lib/libc.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    44# Creates four versions of object file name for all kinds of outputs.
    55.MVER = $(foreach x,aout aout-prof,$.$x/src/lib/$1)
     6
     7# This is the list of object files for libc.dll (appended by some submakefiles)
     8LIBC.DLL.OBJS :=
    69
    710# First of all, include all second-level libc submakefiles
     
    1417.MDESC  := The C library
    1518
    16 .TKIND  := aout
    17 .TARGET := c$A
     19.TARGET := c_p.a
     20.TKIND  := aout prof
    1821.TSRC   := $(libc.TSRC.$(CPU)) $(libc.TSRC)
    1922.TDEP   := $(libc.TDEP.$(CPU)) $(libc.TDEP)
     
    2225include mklib.smak
    2326
    24 .TKIND  := aout prof
    25 .TARGET := c_p$A
     27# Build c.a last since LIBC.DLL needs .OBJS from c.a
     28.TARGET := c.a
     29.TKIND  := aout
     30.TKEEP  := 1
    2631include mklib.smak
    2732
     33#------------------------------------------------------
     34# Now define the rules for building libc$(VERSION).dll
     35#------------------------------------------------------
     36LIBC.DLL = $.aout/libc$(VH)$(VM).dll
     37
     38DO.HELP.MODULES += $(call ECHO,    libc-dll - The dynamic C library (.dll))$(NL)
     39
     40DO.INSTALL += $(call CP,$(LIBC.DLL),$(INS)dll/)$(NL)
     41INSDIRS += $(INS)dll/
     42
     43.PHONY: libc-dll
     44all: libc-dll
     45libc-dll: emxbind emxexp app alias libc os2 $(LIBC.DLL)
     46
     47$(LIBC.DLL): $.aout/src/lib/startup/386/dll0.o $(.OBJS) $(.DEPS) \
     48                $(LIBC.DLL.OBJS) $.aout/libc.def
     49        $(LD) $(LDFLAGS.DLL) -nostdlib -o __libc__ $^ \
     50          -L$.aout -los2 -lgcc -lc_alias
     51        $(call DO.EMXBIND,-d$.aout/libc.def __libc__)
     52        @$(call RM,__libc__)
     53
     54$.aout/libc.def: $.aout/c.a $.aout/c_app.a
     55        $(call RM,$@)
     56        @$(call FECHO,$@,LIBRARY libc$(VH)$(VM))
     57        @$(call FECHO,$@,DESCRIPTION \"GNU C runtime library version $(VERSION)\")
     58        @$(call FECHO,$@,EXPORTS)
     59        $(EMXEXP) -u $^ | sed -e "/^$$/d" -e "/^ *;/d" | sort -d >>$@
     60
    2861# Forget temporary variables
     62include comend.smak
    2963.MVER :=
    3064libc.TSRC.$(CPU) :=
  • trunk/src/emx/src/lib/moddef/moddef.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    22.MDESC  := A library for working with .DEF files
    33
     4.TARGET := moddef.a
    45.TKIND  := aout
    5 .TARGET := moddef$A
    66.TSRC   := $(wildcard src/lib/moddef/*.c)
    77.INSDIR = lib/
  • trunk/src/emx/src/lib/omflib/omflib.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    22.MDESC  := A library for reading/writing OMF object files
    33
     4.TARGET := omflib.a
    45.TKIND  := aout
    5 .TARGET := omflib$A
    66.TSRC   := $(wildcard src/lib/omflib/*.c)
    77.INSDIR = lib/
  • trunk/src/emx/src/lib/os2_386/code2.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r155 r156  
    33#include <emx/asm386.h>
    44
    5         .globl  _DosGetMessage
     5        .globl  DosGetMessage
    66        .globl  __msgseg32
    77
     
    1414        .align  2, 0x90
    1515
    16 _DosGetMessage:
     16DosGetMessage:
    1717        PROFILE_NOFRAME
    1818        popl    %ecx                    /* return address */
    1919        pushl   $__msgseg32
    2020        pushl   %ecx
    21         jmp     _DosTrueGetMessage
     21        jmp     DosTrueGetMessage
    2222
    2323L_tab:  .short  0x0000
  • trunk/src/emx/src/lib/os2_386/code3.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r155 r156  
    33#include <emx/asm386.h>
    44
    5         .globl  _DosQueryMessageCP
     5        .globl  DosQueryMessageCP
    66
    7 _DosQueryMessageCP:
     7DosQueryMessageCP:
    88        PROFILE_NOFRAME
    99        pushl   0(%esp)
     
    1414        xchgl   8(%esp), %eax
    1515        movl    %eax, 4(%esp)
    16         jmp     _DosIQueryMessageCP
     16        jmp     DosIQueryMessageCP
  • trunk/src/emx/src/lib/startup/startup.smak

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r155 r156  
    3434        $(call DO.AOUT2OMF,-m__text)
    3535
    36 # bird: dependencies to help stupid make.
     36# Additional dependencies to help stupid make.
    3737$.omf/src/lib/startup/mcrt0.obj: $.aout/src/lib/startup/mcrt0.o
    3838$.omf/src/lib/startup/gcrt0.obj: $.aout/src/lib/startup/gcrt0.o
  • trunk/src/emx/src/lib/sys/386/thunk0.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r155 r156  
    66                .p2align 2
    77__emx_32to16:   movl    4(%esp),%eax
    8                 jmp     _DosFlatToSel
     8                jmp     DosFlatToSel
    99
    1010                .p2align 2
    1111__emx_16to32:   movl    4(%esp),%eax
    12                 jmp     _DosSelToFlat
     12                jmp     DosSelToFlat
  • trunk/src/emx/src/lib/sys/386/thunk1.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r155 r156  
    6868
    6969                movl    $Lthunk16_call, %eax
    70                 call    _DosFlatToSel
     70                call    DosFlatToSel
    7171                movzwl  %ax, %ecx               # %ecx = offset
    7272                shrl    $16, %eax               # %eax = segment
     
    7575
    7676                movl    %esp, %eax
    77                 call    _DosFlatToSel
     77                call    DosFlatToSel
    7878                movzwl  %ax, %ecx               # %ecx = offset
    7979                shrl    $16, %eax               # %eax = segment
  • trunk/src/emx/src/lib/sys/386/unwind.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r155 r156  
    1010        pushl   $L_cont
    1111        pushl   %eax
    12         call    _DosUnwindException
     12        call    DosUnwindException
    1313L_cont: addl    $3*4, %esp
    1414        ret
  • trunk/src/emx/src/lib/sys/sys.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    1 # Build two kinds of library: aout and aout-profile.
    2 # The OMF libraries will be derived from them.
     1libc.TSRC.386 += $(wildcard src/lib/sys/386/*.s)
     2libc.TSRC += $(wildcard src/lib/sys/*.c)
    33
    4 .MODULE := sys
    5 .MDESC  := System-dependent libc backend
    6 
    7 .TKIND  := aout
    8 .TARGET := sys$A
    9 .TSRC.386 := $(wildcard src/lib/sys/386/*.s)
    10 .TSRC   := $(.TSRC.$(CPU)) $(wildcard src/lib/sys/*.c)
    114.TCF.src/lib/sys/heapsize.c := -DHEAPSIZE=0x2000000
    12 .INSDIR = lib/
    13 .TKEEP  := 1
    14 include mklib.smak
    15 
    16 .TKIND  := aout prof
    17 .TARGET := sys_p$A
    18 include mklib.smak
  • trunk/src/emx/src/libend/end.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    22.MDESC  := The C runtime library that should be linked last
    33
     4.TARGET := end.lib
    45.TKIND  := omf
    5 .TARGET := end$A
    66.TSRC.386 := $(wildcard src/lib/end/386/*.asm)
    77.TSRC   := $(.TSRC.$(CPU))
  • trunk/src/emx/src/libmoddef/moddef.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    22.MDESC  := A library for working with .DEF files
    33
     4.TARGET := moddef.a
    45.TKIND  := aout
    5 .TARGET := moddef$A
    66.TSRC   := $(wildcard src/lib/moddef/*.c)
    77.INSDIR = lib/
  • trunk/src/emx/src/libomflib/omflib.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    22.MDESC  := A library for reading/writing OMF object files
    33
     4.TARGET := omflib.a
    45.TKIND  := aout
    5 .TARGET := omflib$A
    66.TSRC   := $(wildcard src/lib/omflib/*.c)
    77.INSDIR = lib/
  • trunk/src/emx/src/libos2/code2.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r155 r156  
    33#include <emx/asm386.h>
    44
    5         .globl  _DosGetMessage
     5        .globl  DosGetMessage
    66        .globl  __msgseg32
    77
     
    1414        .align  2, 0x90
    1515
    16 _DosGetMessage:
     16DosGetMessage:
    1717        PROFILE_NOFRAME
    1818        popl    %ecx                    /* return address */
    1919        pushl   $__msgseg32
    2020        pushl   %ecx
    21         jmp     _DosTrueGetMessage
     21        jmp     DosTrueGetMessage
    2222
    2323L_tab:  .short  0x0000
  • trunk/src/emx/src/libos2/code3.s

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r155 r156  
    33#include <emx/asm386.h>
    44
    5         .globl  _DosQueryMessageCP
     5        .globl  DosQueryMessageCP
    66
    7 _DosQueryMessageCP:
     7DosQueryMessageCP:
    88        PROFILE_NOFRAME
    99        pushl   0(%esp)
     
    1414        xchgl   8(%esp), %eax
    1515        movl    %eax, 4(%esp)
    16         jmp     _DosIQueryMessageCP
     16        jmp     DosIQueryMessageCP
  • trunk/src/emx/src/regexp/regexp.smak

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r155 r156  
    33.INSDIR := lib/
    44
    5 .TARGET := regexp$A
     5.TARGET := regexp.a
     6.TKIND  := aout
    67.TSRC   := $(wildcard src/regexp/*.c)
    78include mklib.smak
Note: See TracChangeset for help on using the changeset viewer.