Subversion Repositories Kolibri OS

Rev

Rev 5212 | Rev 6324 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. NAME= ld-new
  2.  
  3. LIB_DIR:= $(SDK_DIR)/lib
  4.  
  5. CFLAGS_OPT = -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER -O2
  6. CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields
  7. CFLAGS_OPT+= -W -Wall -Wmissing-prototypes -Wno-format -Werror
  8. CFLAGS   = -c -save-temps $(CFLAGS_OPT)
  9.  
  10. INCLUDES= -I. -I../bfd -I../include -I$(SDK_DIR)/sources/newlib/libc/include
  11.  
  12. DEFINES=  -DHAVE_CONFIG_H -DLOCALEDIR='"/home/autobuild/tools/win32/share/locale"'
  13. FDEFS=    -DSCRIPTDIR='"/home/autobuild/tools/win32/mingw32/lib"' -DBINDIR='"/home/autobuild/tools/win32/bin"'
  14. FDEFS+=   -DTOOLBINDIR='"/home/autobuild/tools/win32/mingw32/bin"'
  15. MDEFS=    -DDEFAULT_EMULATION='"i386pe"' -DBINDIR='"/home/autobuild/tools/win32/bin"'
  16. MDEFS+=   -DTOOLBINDIR='"/home/autobuild/tools/win32/mingw32/bin"' -DTARGET='"i686-pc-mingw32"'
  17. MDEFS+=   -DTARGET_SYSTEM_ROOT='"/home/autobuild/tools/win32"' -DTARGET_SYSTEM_ROOT_RELOCATABLE
  18.  
  19. LIBS= -lbfd -liberty -lz -lgcc -lc.dll -lapp
  20.  
  21. LIBPATH:= -L$(LIB_DIR) -L/home/autobuild/tools/win32/mingw32/lib
  22.  
  23. LDFLAGS = -static -nostdlib --stack 12582912 -T$(SDK_DIR)/sources/newlib/app.lds --image-base 0
  24.  
  25.  
  26. SRCS = \
  27.         deffilep.c ei386pe.c            \
  28.         ldcref.c ldctor.c ldemul.c      \
  29.         ldexp.c  ldfile.c ldgram.c      \
  30.         ldlang.c ldlex-wrapper.c        \
  31.         ldmain.c ldmisc.c  ldver.c      \
  32.         ldwrite.c lexsup.c mri.c        \
  33.         pe-dll.c
  34.  
  35.  
  36.  
  37. OBJS  =  $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS)))
  38.  
  39. # targets
  40.  
  41. all: $(NAME)
  42.  
  43. $(NAME): $(OBJS) Makefile
  44.         $(LD) $(LDFLAGS) $(LIBPATH) -o $@ $(OBJS) $(LIBS)
  45.         kos32-objcopy $@ -O binary
  46.  
  47. %.o : %.c Makefile
  48.         $(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
  49.  
  50. ldfile.o : ldfile.c Makefile
  51.         $(CC) $(CFLAGS) $(DEFINES) $(FDEFS) $(INCLUDES) -o $@ $<
  52.  
  53. ldmain.o : ldmain.c Makefile
  54.         $(CC) $(CFLAGS) $(DEFINES) $(MDEFS) $(INCLUDES) -o $@ $<
  55.