Lines 6-40
Link Here
|
6 |
DEFINES=@DEFINES@ -DMELF_COMP |
6 |
DEFINES=@DEFINES@ -DMELF_COMP |
7 |
INCLUDES=-I. |
7 |
INCLUDES=-I. |
8 |
PREFIX=@PREFIX@ |
8 |
PREFIX=@PREFIX@ |
9 |
CFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} -Wall -O3 -fPIC |
9 |
OPTFLAGS=-Wall -O3 |
10 |
LFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} -Wall -O3 -o |
10 |
CFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} ${OPTFLAGS} |
|
|
11 |
LFLAGS=${DEBUG} ${DEFINES} ${INCLUDES} ${OPTFLAGS} -o |
12 |
LIBDIR=lib |
11 |
LIBS= |
13 |
LIBS= |
12 |
OBJS=melf.o melf_dynamic.o melf_elf.o melf_list.o melf_note.o melf_program.o melf_reloc.o \ |
14 |
OBJS=melf.o melf_dynamic.o melf_elf.o melf_list.o melf_note.o melf_program.o melf_reloc.o \ |
13 |
melf_res.o melf_section.o melf_string.o melf_symbol.o melf_symbolTable.o |
15 |
melf_res.o melf_section.o melf_string.o melf_symbol.o melf_symbolTable.o |
14 |
|
16 |
|
15 |
all: ${OBJS} |
17 |
all: ${STATICBIN} ${DYNAMICBIN} |
16 |
ar rc ${STATICBIN} ${OBJS} && ranlib ${STATICBIN} |
18 |
cd example && $(MAKE) |
17 |
@SHAREDEXEC@ |
19 |
cd tools && $(MAKE) |
18 |
cd example && make |
|
|
19 |
cd tools && make |
20 |
|
20 |
|
21 |
*.c.${O}: |
21 |
*.c.${O}: |
22 |
${CC} ${CFLAGS} $*.c |
22 |
${CC} ${CFLAGS} $*.c |
23 |
|
23 |
|
|
|
24 |
${STATICBIN}: ${OBJS} |
25 |
$(AR) rc ${STATICBIN} ${OBJS} && $(RANLIB) ${STATICBIN} |
26 |
${DYNAMICBIN}: ${OBJS} |
27 |
${CC} -Wl,-soname=$@ ${LDFLAGS} -shared -fPIC ${OBJS} -o libmelf.so |
28 |
|
24 |
clean: |
29 |
clean: |
25 |
rm -f *.o ${STATICBIN} ${DYNAMICBIN} example/test example/new example/sign tools/elfres config.* |
30 |
rm -f *.o ${STATICBIN} ${DYNAMICBIN} example/test example/new example/sign tools/elfres config.* |
26 |
cd tools && make clean |
31 |
cd tools && $(MAKE) clean |
27 |
|
32 |
|
28 |
distclean: |
33 |
distclean: clean |
29 |
make clean |
|
|
30 |
rm -f Makefile example/Makefile stdelf.h |
34 |
rm -f Makefile example/Makefile stdelf.h |
31 |
cd tools && make distclean |
35 |
cd tools && $(MAKE) distclean |
32 |
|
36 |
|
33 |
install: ${OBJS} ${STATICBIN} |
37 |
install: ${OBJS} ${STATICBIN} |
34 |
cp libmelf.a ${PREFIX}/lib |
38 |
cp ${STATICBIN} ${PREFIX}/$(LIBDIR) |
35 |
cp libmelf.so ${PREFIX}/lib |
39 |
cp ${DYNAMICBIN} ${PREFIX}/$(LIBDIR) |
36 |
cp melf.h ${PREFIX}/include |
40 |
cp melf.h ${PREFIX}/include |
37 |
cp stdelf.h ${PREFIX}/include |
41 |
cp stdelf.h ${PREFIX}/include |
38 |
|
42 |
|
39 |
uninstall: |
43 |
uninstall: |
40 |
rm -f ${PREFIX}/lib/libmelf.a ${PREFIX}/lib/libmelf.so ${PREFIX}/include/melf.h ${PREFIX}/include/stdelf.h |
44 |
-rm -f \ |
|
|
45 |
${PREFIX}/$(LIBDIR)/${STATICBIN} \ |
46 |
${PREFIX}/$(LIBDIR)/${DYNAMICBIN} \ |
47 |
${PREFIX}/include/melf.h \ |
48 |
${PREFIX}/include/stdelf.h |