diff options
Diffstat (limited to 'libc/sysdeps/linux/e1/Makefile')
-rw-r--r-- | libc/sysdeps/linux/e1/Makefile | 61 |
1 files changed, 21 insertions, 40 deletions
diff --git a/libc/sysdeps/linux/e1/Makefile b/libc/sysdeps/linux/e1/Makefile index e02888ac4..4e37d329f 100644 --- a/libc/sysdeps/linux/e1/Makefile +++ b/libc/sysdeps/linux/e1/Makefile @@ -24,61 +24,42 @@ UCLIBC_CTOR_DTOR=n # If you're looking for vfork(), it is defined in include/unistd.h +CRT_SRC := crt0.S +CRT_OBJ := crt0.o +CTOR_TARGETS := $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o -CRT0=crt0.S -CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0)) -CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o +# why is crt1.c listed in CSRC ? +CSRC := crt1.c syscalls.c longjmp.c setjmp.c vfork.c +OBJS := $(patsubst %.c,%.o, $(CSRC)) -SSRC= -SOBJS=$(patsubst %.S,%.o, $(SSRC)) +OBJ_LIST := ../../../obj.sysdeps.$(TARGET_ARCH) -CSRC=crt1.c syscalls.c longjmp.c setjmp.c vfork.c -COBJS=$(patsubst %.c,%.o, $(CSRC)) +all: $(OBJ_LIST) $(CTOR_TARGETS) -OBJS=$(SOBJS) $(MOBJ) $(COBJS) $(CRT0_OBJ) - -OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH) - -all: $(OBJ_LIST) - -$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(CTOR_TARGETS) - echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST) +$(OBJ_LIST): $(OBJS) $(CRT_OBJ) + $(STRIPTOOL) -x -R .note -R .comment $^ $(INSTALL) -d $(TOPDIR)lib/ - cp $(CRT0_OBJ) $(TOPDIR)lib/$(CRT0_OBJ) - -$(CRT0_OBJ): %.o : %.S - $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o + cp $(CRT_OBJ) $(TOPDIR)lib/ + echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $@ -$(SOBJS): %.o : %.S +$(CRT_OBJ): %.o : %.S $(CC) $(ASFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o -$(COBJS): %.o : %.c +$(OBJS): %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) -crti.o: crti.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crti.S -o crti.o -$(TOPDIR)lib/crti.o: crti.o +ifeq ($(UCLIBC_CTOR_DTOR),y) +$(TOPDIR)lib/crti.o: crti.S $(INSTALL) -d $(TOPDIR)lib/ - cp crti.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ -crtn.o: crtn.S - $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c crtn.S -o crtn.o - -$(TOPDIR)lib/crtn.o: crtn.o +$(TOPDIR)lib/crtn.o: crtn.S $(INSTALL) -d $(TOPDIR)lib/ - cp crtn.o $(TOPDIR)lib/ + $(CC) $(ASFLAGS) $(SSP_DISABLE_FLAGS) -c $< -o $@ else -$(TOPDIR)lib/crti.o: - $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o -$(TOPDIR)lib/crtn.o: +$(CTOR_TARGETS): $(INSTALL) -d $(TOPDIR)lib/ - $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o + $(AR) $(ARFLAGS) $@ endif headers: |