Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
9758 | maxcodehac | 1 | # dynamic linking |
2 | |||
3 | CC = kos32-gcc |
||
4 | LD = kos32-ld |
||
5 | |||
6 | SDK_DIR = $(abspath ../..) |
||
7 | |||
8 | CFLAGS = -c -fno-ident -O2 -fomit-frame-pointer -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 |
||
9 | LDFLAGS = -static -S -Tapp-dynamic.lds --image-base 0 |
||
10 | |||
11 | INCLUDES = -I $(SDK_DIR)/sources/newlib/libc/include |
||
12 | LIBPATH = -L $(SDK_DIR)/lib |
||
13 | |||
14 | SOURCES = hello.c |
||
15 | OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) |
||
16 | |||
17 | default: hello |
||
18 | |||
19 | hello: $(OBJECTS) Makefile |
||
20 | $(LD) $(LDFLAGS) $(LIBPATH) -o hello $(OBJECTS) -lgcc -lc.dll |
||
21 | strip -s hello -o hello |
||
22 | objcopy hello -O binary |
||
23 | |||
24 | %.o : %.c Makefile $(SOURCES) |
||
25 | $(CC) $(CFLAGS) $(INCLUDES) -o $@ $<> |