summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libdl/Makefile
blob: 29164f105f903d1ee33c72a889125584d591199f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# local "test" make file

CC  = gcc
DCC = diet $(CC)

SRC = $(wildcard *.c) # test/test.c
OBJ = _dl_jump.o $(SRC:.c=.o)

#CFLAGS = -Wall -D__OD_CLEAN_ROOM -DNODIETREF -fPIC -g -O
CFLAGS = -Wall -O2 -D__OD_CLEAN_ROOM -DNODIETREF -fPIC -frerun-loop-opt -fschedule-insns2 $(DEB) # -fomit-frame-pointer

%.o : %.S
	$(DCC) $(CFLAGS) -c -o $@ $^

%.o : %.c
	$(DCC) $(CFLAGS) -c -o $@ $^

it: t.out

a.out: t.out
	gcc -O -g test/a.c t.out -L/opt/diet/lib-i386 -lc -lgcc -o $@ -Wl,-dynamic-linker=`pwd`/t.out -nostdlib

t.out: _dl_main.o
	ld -shared -o $@ $? -soname=libdl.so

all: test.out libdl.a

libdl.a: $(OBJ)
	ar cru $@ $^

test.g: test/test.c
	gcc -o $@ $^ -ldl

test.out: $(OBJ) test/test.o
	diet gcc -o $@ $^

clean:
	$(RM) *.o *.a *.out *~ # *.so