X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=Makefile;h=b46f8ca436a5fdfa805525e16a5baf8607cbbf16;hb=a108127256a188130a80d6c7762ec8820e663b7c;hp=ec54880d36250d65899eeef773a780646ed2c49a;hpb=8b084f06d0e17a8814147c386042f19829aff961;p=musl diff --git a/Makefile b/Makefile index ec54880d..b46f8ca4 100644 --- a/Makefile +++ b/Makefile @@ -33,9 +33,9 @@ CRT_OBJS = $(filter obj/crt/%,$(ALL_OBJS)) AOBJS = $(LIBC_OBJS) LOBJS = $(LIBC_OBJS:.o=.lo) -GENH = obj/include/bits/alltypes.h +GENH = obj/include/bits/alltypes.h obj/include/bits/syscall.h GENH_INT = obj/src/internal/version.h -IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/libc.h) +IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/locale_impl.h src/internal/libc.h) LDFLAGS = LDFLAGS_AUTO = @@ -46,7 +46,7 @@ CFLAGS_AUTO = -Os -pipe CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc CFLAGS_ALL = $(CFLAGS_C99FSE) -CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include +CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS) LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS) @@ -96,6 +96,10 @@ $(OBJ_DIRS): obj/include/bits/alltypes.h: $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in $(srcdir)/tools/mkalltypes.sed sed -f $(srcdir)/tools/mkalltypes.sed $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in > $@ +obj/include/bits/syscall.h: $(srcdir)/arch/$(ARCH)/bits/syscall.h.in + cp $< $@ + sed -n -e s/__NR_/SYS_/p < $< >> $@ + obj/src/internal/version.h: $(wildcard $(srcdir)/VERSION $(srcdir)/.git) printf '#define VERSION "%s"\n' "$$(cd $(srcdir); sh tools/version.sh)" > $@ @@ -109,24 +113,17 @@ obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart.c obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC -obj/crt/$(ARCH)/crti.o: $(srcdir)/crt/$(ARCH)/crti.s - -obj/crt/$(ARCH)/crtn.o: $(srcdir)/crt/$(ARCH)/crtn.s - OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%)) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3 -MEMOPS_SRCS = src/string/memcpy.c src/string/memmove.c src/string/memcmp.c src/string/memset.c -$(MEMOPS_SRCS:%.c=obj/%.o) $(MEMOPS_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_MEMOPS) - -NOSSP_SRCS = $(wildcard crt/*.c) \ - src/env/__libc_start_main.c src/env/__init_tls.c \ - src/env/__stack_chk_fail.c \ - src/thread/__set_thread_area.c src/thread/$(ARCH)/__set_thread_area.c \ - src/string/memset.c src/string/$(ARCH)/memset.c \ - src/string/memcpy.c src/string/$(ARCH)/memcpy.c \ - ldso/dlstart.c ldso/dynlink.c -$(NOSSP_SRCS:%.c=obj/%.o) $(NOSSP_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP) +MEMOPS_OBJS = $(filter %/memcpy.o %/memmove.o %/memcmp.o %/memset.o, $(LIBC_OBJS)) +$(MEMOPS_OBJS) $(MEMOPS_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_MEMOPS) + +NOSSP_OBJS = $(CRT_OBJS) $(LDSO_OBJS) $(filter \ + %/__libc_start_main.o %/__init_tls.o %/__stack_chk_fail.o \ + %/__set_thread_area.o %/memset.o %/memcpy.o \ + , $(LIBC_OBJS)) +$(NOSSP_OBJS) $(NOSSP_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP) $(CRT_OBJS): CFLAGS_ALL += -DCRT