Makefile 807 B

12345678910111213141516171819202122232425262728293031323334353637
  1. TOPDIR=../../
  2. include $(TOPDIR)/ldso/Rules.mak
  3. CFLAGS += -DLDSO_ADDR="0x62f00020" # needed by ldd.o
  4. CFLAGS += -I./ -I../../include/
  5. LDFLAGS += -nostdlib $(TOPDIR)lib/libc.a $(TOPDIR)lib/crt0.o $(GCCINCDIR)/../libgcc.a
  6. ALL = ldconfig ldd # lddstub
  7. all: $(ALL)
  8. CSRC= readelf.c ldconfig.c ldd.c
  9. COBJS=$(patsubst %.c,%.o, $(CSRC))
  10. OBJS=$(COBJS)
  11. $(COBJS): %.o : %.c
  12. $(CC) $(CFLAGS) -c $< -o $@
  13. $(STRIPTOOL) -x -R .note -R .comment $*.o
  14. readelf.o: readelf.c readelf2.c
  15. ldconfig: ldconfig.o readelf.o
  16. $(CC) -static $(CFLAGS) $^ $(LDFLAGS) -o $@
  17. ldd: ldd.o readelf.o
  18. $(CC) -static $(CFLAGS) $^ $(LDFLAGS) -o $@
  19. #ifeq ($(DEBUG),true)
  20. #STUBFLAGS = -Wl,-dynamic-linker,../d-link/ld-linux.so
  21. #endif
  22. #lddstub: lddstub.o
  23. # $(CC) $(CFLAGS) $(LDFLAGS) $(STUBFLAGS) $^ -o $@
  24. clean:
  25. rm -f $(ALL) *.o *~ core