Rev 5223 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5199 | serge | 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 |
||
6324 | serge | 8 | ELF_CFLAGS = -DELF_LIST_OPTIONS=FALSE -DELF_SHLIB_LIST_OPTIONS=FALSE |
9 | ELF_CFLAGS+= -DELF_PLT_UNWIND_LIST_OPTIONS=FALSE |
||
10 | CFLAGS = -c -save-temps $(CFLAGS_OPT) $(ELF_CFLAGS) |
||
5199 | serge | 11 | |
12 | INCLUDES= -I. -I../bfd -I../include -I$(SDK_DIR)/sources/newlib/libc/include |
||
13 | |||
14 | DEFINES= -DHAVE_CONFIG_H -DLOCALEDIR='"/home/autobuild/tools/win32/share/locale"' |
||
15 | FDEFS= -DSCRIPTDIR='"/home/autobuild/tools/win32/mingw32/lib"' -DBINDIR='"/home/autobuild/tools/win32/bin"' |
||
16 | FDEFS+= -DTOOLBINDIR='"/home/autobuild/tools/win32/mingw32/bin"' |
||
17 | MDEFS= -DDEFAULT_EMULATION='"i386pe"' -DBINDIR='"/home/autobuild/tools/win32/bin"' |
||
18 | MDEFS+= -DTOOLBINDIR='"/home/autobuild/tools/win32/mingw32/bin"' -DTARGET='"i686-pc-mingw32"' |
||
19 | MDEFS+= -DTARGET_SYSTEM_ROOT='"/home/autobuild/tools/win32"' -DTARGET_SYSTEM_ROOT_RELOCATABLE |
||
20 | |||
21 | LIBS= -lbfd -liberty -lz -lgcc -lc.dll -lapp |
||
22 | |||
23 | LIBPATH:= -L$(LIB_DIR) -L/home/autobuild/tools/win32/mingw32/lib |
||
24 | |||
6324 | serge | 25 | LDFLAGS = -static -nostdlib --stack 12582912 -T$(SDK_DIR)/sources/newlib/app.lds --image-base 0 --subsystem native |
5199 | serge | 26 | |
27 | |||
28 | SRCS = \ |
||
6324 | serge | 29 | deffilep.c ei386pe.c ldbuildid.c\ |
5199 | serge | 30 | ldcref.c ldctor.c ldemul.c \ |
31 | ldexp.c ldfile.c ldgram.c \ |
||
32 | ldlang.c ldlex-wrapper.c \ |
||
33 | ldmain.c ldmisc.c ldver.c \ |
||
34 | ldwrite.c lexsup.c mri.c \ |
||
35 | pe-dll.c |
||
36 | |||
37 | |||
38 | |||
39 | OBJS = $(patsubst %.cpp, %.o, $(patsubst %.c, %.o, $(SRCS))) |
||
40 | |||
41 | # targets |
||
42 | |||
43 | all: $(NAME) |
||
44 | |||
45 | $(NAME): $(OBJS) Makefile |
||
46 | $(LD) $(LDFLAGS) $(LIBPATH) -o $@ $(OBJS) $(LIBS) |
||
47 | kos32-objcopy $@ -O binary |
||
48 | |||
49 | %.o : %.c Makefile |
||
50 | $(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $< |
||
51 | |||
52 | ldfile.o : ldfile.c Makefile |
||
53 | $(CC) $(CFLAGS) $(DEFINES) $(FDEFS) $(INCLUDES) -o $@ $< |
||
54 | |||
55 | ldmain.o : ldmain.c Makefile |
||
56 | $(CC) $(CFLAGS) $(DEFINES) $(MDEFS) $(INCLUDES) -o $@ $<> |
||
57 |