Makefile 808 B

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