From 1069757073a571f3ffd69370e4c4fd7e3e364cbc Mon Sep 17 00:00:00 2001 From: Alexander van der Grinten Date: Wed, 20 Feb 2019 18:59:22 +0100 Subject: [PATCH] Remove unused makefiles --- configure | 30 ---- libc.makefile | 300 ---------------------------------------- libdl/dir.makefile | 33 ----- libm/dir.makefile | 33 ----- libpthread/dir.makefile | 33 ----- librt/dir.makefile | 33 ----- libutil/dir.makefile | 33 ----- rules.makefile | 15 -- toplevel.makefile | 25 ---- 9 files changed, 535 deletions(-) delete mode 100755 configure delete mode 100644 libc.makefile delete mode 100644 libdl/dir.makefile delete mode 100644 libm/dir.makefile delete mode 100644 libpthread/dir.makefile delete mode 100644 librt/dir.makefile delete mode 100644 libutil/dir.makefile delete mode 100644 rules.makefile delete mode 100644 toplevel.makefile diff --git a/configure b/configure deleted file mode 100755 index e5c59010..00000000 --- a/configure +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python - -import sys -import os -import argparse - -parser = argparse.ArgumentParser() -parser.add_argument('--sysroot', required=True) -parser.add_argument('--frigg-path', required=True) -parser.add_argument('--managarm-src-path', required=True) -parser.add_argument('--managarm-build-path', required=True) - -args = parser.parse_args() - -script_dir = os.path.dirname(sys.argv[0]) -make_cfg = { "TREE_PATH": os.path.relpath(os.path.realpath(script_dir)), - "BUILD_PATH": os.path.relpath(os.path.realpath(os.getcwd())), - "SYSROOT_PATH": os.path.relpath(os.path.realpath(args.sysroot)), - "FRIGG_PATH": args.frigg_path, - "MANAGARM_SRC_PATH": args.managarm_src_path, - "MANAGARM_BUILD_PATH": args.managarm_build_path -} - -make_fd = open('makefile', 'w') -for k, v in make_cfg.iteritems(): - make_fd.write("%s = %s\n" % (k, v)) -make_fd.write("\n") -make_fd.write("include $(TREE_PATH)/toplevel.makefile\n") -make_fd.close() - diff --git a/libc.makefile b/libc.makefile deleted file mode 100644 index 32d5e2f3..00000000 --- a/libc.makefile +++ /dev/null @@ -1,300 +0,0 @@ - -libc_CC := x86_64-managarm-gcc -libc_CXX := x86_64-managarm-g++ - -libc_CPPFLAGS := -Wall -libc_CPPFLAGS += -I$(TREE_PATH)/options/internal/private -libc_CPPFLAGS += -I$(TREE_PATH)/options/ansi/include -libc_CPPFLAGS += -I$(TREE_PATH)/options/linux/include -libc_CPPFLAGS += -I$(TREE_PATH)/options/lsb/include -libc_CPPFLAGS += -I$(TREE_PATH)/options/posix/include -libc_CPPFLAGS += -I$(TREE_PATH)/options/internal/include -libc_CPPFLAGS += -I$(TREE_PATH)/sysdeps/managarm/include -libc_CPPFLAGS += -Igen -libc_CPPFLAGS += -I$(FRIGG_PATH)/include -libc_CPPFLAGS += -DFRIGG_HAVE_LIBC -DFRIGG_HIDDEN - -libc_CFLAGS := $(libc_CPPFLAGS) -fPIC -O2 -libc_CFLAGS += -fno-builtin - -libc_CXXFLAGS := $(libc_CPPFLAGS) -fPIC -O2 -libc_CXXFLAGS += -fno-builtin -fno-rtti -fno-exceptions - -libc_BEGIN := options/internal/gcc-extra/mlibc_crtbegin.o -libc_END := options/internal/gcc-extra/mlibc_crtend.o - -libc_gendir := gen - -libc_include_dirs := options/internal/include \ - options/ansi/include \ - options/posix/include \ - options/lsb/include \ - options/linux/include \ - sysdeps/managarm/include - -pretty = @echo '\t\e[1m$2\e[0m $3'; if ! $1; then \ - echo "\e[31mError in" '\e[1m$2\e[0m\e[31m $3!\e[39m' \ - "Command line was:"; echo '\e[31m$1\e[39m'; exit 1; fi -quiet = @if ! $1; then \ - echo "\e[31mError in" '\e[1m$2\e[0m\e[31m $3!\e[39m'\ - "Command line was:"; echo '\e[31m$1\e[39m'; exit 1; fi - -proto_cmd = $(PROTOC) \ - --plugin=protoc-gen-frigg=$(MANAGARM_BUILD_PATH)/tools/frigg_pb/bin/frigg_pb \ - --frigg_out=$(libc_gendir) --proto_path=$(MANAGARM_SRC_PATH)/bragi/proto $< -compile_s_cmd = $(libc_AS) -o $@ $($libc_ASFLAGS) $< -compile_c_cmd = $(libc_CC) -c -o $@ -std=c11 $(libc_CFLAGS) $< -compile_cxx_cmd = $(libc_CXX) -c -o $@ -std=c++17 $(libc_CXXFLAGS) $< -link_cxx_cmd = x86_64-managarm-g++ -shared -o $@ -nostdlib \ - $(libc_BEGIN) $(libc_objects) -l:ld-init.so $(libc_END) -install_header_cmd = install -Dp $< $@ -install_slib_cmd = install -Dp $< $@ -install_crt_cmd = install -Dp $< $@ - -proto_pretty = $(call pretty,$(proto_cmd),protoc,$@) -compile_s_pretty = $(call pretty,$(compile_s_cmd),as,$@) -compile_c_pretty = $(call pretty,$(compile_c_cmd),cc,$@) -compile_cxx_pretty = $(call pretty,$(compile_cxx_cmd),c++,$@) -link_cxx_pretty = $(call pretty,$(link_cxx_cmd),link,$@) -install_header_pretty = $(call pretty,$(install_header_cmd),install,$@) -install_slib_pretty = $(call pretty,$(install_slib_cmd),install,$@) -install_crt_pretty = $(call pretty,$(install_crt_cmd),install,$@) - -#Ansi -libc_includes := alloca.h \ - assert.h \ - ctype.h \ - errno.h \ - fenv.h \ - inttypes.h \ - limits.h \ - locale.h \ - math.h \ - bits/ansi/clockid_t.h \ - bits/ansi/seek.h \ - bits/ansi/timespec.h \ - bits/ansi/time_t.h \ - setjmp.h \ - signal.h \ - stdio.h \ - stdlib.h \ - string.h \ - time.h \ - wchar.h -#Internal -libc_includes += \ - bits/ensure.h \ - bits/feature.h \ - bits/machine.h \ - bits/null.h \ - bits/size_t.h \ - bits/types.h \ - bits/wchar_t.h \ - stdint.h -#Linux -libc_includes += \ - asm/ioctls.h \ - getopt.h \ - linux/bpf_common.h \ - linux/bsg.h \ - linux/cdrom.h \ - linux/hdreg.h \ - linux/filter.h \ - linux/fs.h \ - linux/input.h \ - linux/kd.h \ - linux/magic.h \ - linux/major.h \ - linux/netlink.h \ - linux/pci_regs.h \ - linux/sched.h \ - linux/sockios.h \ - linux/types.h \ - linux/videodev2.h \ - linux/vt.h \ - malloc.h \ - memory.h \ - mntent.h \ - net/if_arp.h \ - poll.h \ - pty.h \ - scsi/sg.h \ - scsi/scsi.h \ - scsi/scsi_ioctl.h \ - stdio_ext.h \ - sys/epoll.h \ - sys/inotify.h \ - sys/ioctl.h \ - sys/mount.h \ - sys/prctl.h \ - sys/ptrace.h \ - sys/random.h \ - sys/sendfile.h \ - sys/signalfd.h \ - sys/sysmacros.h \ - sys/timerfd.h \ - utmp.h \ - values.h -#LSB -libc_includes += sys/auxv.h -#Posix -libc_includes += arpa/inet.h \ - byteswap.h \ - dirent.h \ - dlfcn.h \ - endian.h \ - fcntl.h \ - fnmatch.h \ - ftw.h \ - glob.h \ - grp.h \ - langinfo.h \ - libgen.h \ - bits/posix/blkcnt_t.h \ - bits/posix/blksize_t.h \ - bits/posix/dev_t.h \ - bits/posix/file.h \ - bits/posix/fsblkcnt_t.h \ - bits/posix/fsfilcnt_t.h \ - bits/posix/gid_t.h \ - bits/posix/id_t.h \ - bits/posix/in_addr_t.h \ - bits/posix/ino_t.h \ - bits/posix/in_port_t.h \ - bits/posix/iovec.h \ - bits/posix/locale_t.h \ - bits/posix/mode_t.h \ - bits/posix/nlink_t.h \ - bits/posix/nl_item.h \ - bits/posix/off_t.h \ - bits/posix/pid_t.h \ - bits/posix/posix_errno.h \ - bits/posix/posix_signal.h \ - bits/posix/posix_stdio.h \ - bits/posix/posix_stdlib.h \ - bits/posix/posix_string.h \ - bits/posix/sa_family_t.h \ - bits/posix/siginfo_t.h \ - bits/posix/socklen_t.h \ - bits/posix/ssize_t.h \ - bits/posix/stat.h \ - bits/posix/suseconds_t.h \ - bits/posix/timeval.h \ - bits/posix/uid_t.h \ - net/if.h \ - netdb.h \ - netinet/in.h \ - netinet/ip.h \ - pthread.h \ - pwd.h \ - sched.h \ - spawn.h \ - strings.h \ - sys/file.h \ - sys/mman.h \ - sys/param.h \ - sys/resource.h \ - sys/select.h \ - sys/socket.h \ - sys/statfs.h \ - sys/stat.h \ - sys/statvfs.h \ - sys/time.h \ - sys/types.h \ - sys/uio.h \ - sys/un.h \ - sys/utsname.h \ - sys/vfs.h \ - sys/wait.h \ - syslog.h \ - termios.h \ - unistd.h \ - utime.h -# sysdeps/managarm -libc_includes += bits/abi.h - -$(foreach d,$(libc_include_dirs),\ - $(eval $(SYSROOT_PATH)/usr/include/%.h: $d/%.h ; $(value install_header_pretty))) - -$(SYSROOT_PATH)/usr/lib/libc.so: libc.so - $(install_slib_pretty) - -$(SYSROOT_PATH)/usr/lib/crt0.o: sysdeps/managarm/crt-src/crt0.o - $(install_crt_pretty) - -libc_code_dirs := options/ansi/generic \ - options/ansi/musl-generic-math -libc_code_dirs += options/linux/generic -libc_code_dirs += options/lsb/generic -libc_code_dirs += options/posix/generic \ - options/posix/musl-generic -libc_code_dirs += options/internal/generic \ - options/internal/gcc \ - options/internal/gcc-extra \ - options/internal/x86_64 - -libc_code_dirs += sysdeps/managarm/crt-src \ - sysdeps/managarm/generic \ - sysdeps/managarm/x86_64 - -libc_s_sources := $(wildcard $(TREE_PATH)/options/internal/x86_64/*.S) -libc_s_sources += $(wildcard $(TREE_PATH)/sysdeps/managarm/x86_64/*.S) - -libc_c_sources := $(wildcard $(TREE_PATH)/options/ansi/musl-generic-math/*.c) - -libc_cxx_sources := $(wildcard $(TREE_PATH)/options/ansi/generic/*.cpp) -libc_cxx_sources += $(wildcard $(TREE_PATH)/options/linux/generic/*.cpp) -libc_cxx_sources += $(wildcard $(TREE_PATH)/options/lsb/generic/*.cpp) -libc_cxx_sources += $(wildcard $(TREE_PATH)/options/posix/generic/*.cpp) -libc_cxx_sources += $(wildcard $(TREE_PATH)/options/posix/musl-generic/*.cpp) -libc_cxx_sources += $(wildcard $(TREE_PATH)/options/internal/generic/*.cpp) -libc_cxx_sources += $(wildcard $(TREE_PATH)/options/internal/gcc/*.cpp) -libc_cxx_sources += $(wildcard $(TREE_PATH)/sysdeps/managarm/generic/*.cpp) - -libc_objects := $(patsubst $(TREE_PATH)/%.S,%.o,$(libc_s_sources)) -libc_objects += $(patsubst $(TREE_PATH)/%.c,%.o,$(libc_c_sources)) -libc_objects += $(patsubst $(TREE_PATH)/%.cpp,%.o,$(libc_cxx_sources)) - -libc_AS := x86_64-managarm-as -libc_ASFLAGS := - -vpath %.h $(TREE_PATH) -vpath %.S $(TREE_PATH) -vpath %.c $(TREE_PATH) -vpath %.cpp $(TREE_PATH) - -$(libc_code_dirs): - $(call quiet,mkdir -p $@,mkdir,$@) - -$(libc_gendir): - $(call quiet,mkdir -p $@,mkdir,$@) - -%.o: %.S | $(libc_code_dirs) - $(compile_s_pretty) - -# TODO: Speed up compilation by calling GCC only once. -%.o: %.c | $(libc_code_dirs) - $(compile_c_pretty) - @$(libc_CC) $(libc_CPPFLAGS) -std=c11 -MM -MP -MF $(@:%.o=%.d) -MT "$@" -MT "$(@:%.o=%.d)" $< - -# TODO: Speed up compilation by calling GCC only once. -%.o: %.cpp | $(libc_code_dirs) - $(compile_cxx_pretty) - @$(libc_CXX) $(libc_CPPFLAGS) -std=c++17 -MM -MP -MF $(@:%.o=%.d) -MT "$@" -MT "$(@:%.o=%.d)" $< - -libc.so: $(libc_objects) $(libc_BEGIN) $(libc_END) - $(link_cxx_pretty) - -gen-libc: $(libc_gendir)/posix.frigg_pb.hpp $(libc_gendir)/fs.frigg_pb.hpp - -install-headers-libc: $(addprefix $(SYSROOT_PATH)/usr/include/,$(libc_includes)) - -install-libc: $(addprefix $(SYSROOT_PATH)/usr/include/,$(libc_includes)) -install-libc: $(SYSROOT_PATH)/usr/lib/crt0.o -install-libc: $(SYSROOT_PATH)/usr/lib/libc.so - -$(libc_gendir)/%.frigg_pb.hpp: $(MANAGARM_SRC_PATH)/bragi/proto/%.proto | $(libc_gendir) - $(proto_pretty) - --include $(libc_objects:%.o=%.d) - diff --git a/libdl/dir.makefile b/libdl/dir.makefile deleted file mode 100644 index 27c265bc..00000000 --- a/libdl/dir.makefile +++ /dev/null @@ -1,33 +0,0 @@ - -$c_SRCDIR := $(TREE_PATH)/$c/src -$c_BINDIR := $(BUILD_PATH)/$c/bin -$c_OBJDIR := $(BUILD_PATH)/$c/obj - -$c_LIBRARY_OBJS := $($c_OBJDIR)/dummy.o - -# FIXME: We do have crtbegin/crtend here so global ctors do not work! -# Either build libdl after libgcc or include a private version of crtbegin/crtend. -$c_LDFLAGS := -nostdlib - -$c_TARGETS := clean-$c install-$c $($c_BINDIR)/libdl.so - -.PHONY: all-$c install-$c - -all-$c: $($c_BINDIR)/libdl.so - -clean-$c: - rm -f $($c_BINDIR)/libdl.so - -$($c_OBJDIR) $($c_BINDIR): - mkdir -p $@ - -$($c_OBJDIR)/%.o: $($c_SRCDIR)/%.cpp | $($c_OBJDIR) - x86_64-managarm-g++ -c -o $@ $< - -$($c_BINDIR)/libdl.so: $($c_LIBRARY_OBJS) | $($c_BINDIR) - x86_64-managarm-g++ -shared -o $@ $($c_LDFLAGS) $($c_LIBRARY_OBJS) - -install-$c: - mkdir -p $(SYSROOT_PATH)/usr/lib - install $($c_BINDIR)/libdl.so $(SYSROOT_PATH)/usr/lib - diff --git a/libm/dir.makefile b/libm/dir.makefile deleted file mode 100644 index 5287d789..00000000 --- a/libm/dir.makefile +++ /dev/null @@ -1,33 +0,0 @@ - -$c_SRCDIR := $(TREE_PATH)/$c/src -$c_BINDIR := $(BUILD_PATH)/$c/bin -$c_OBJDIR := $(BUILD_PATH)/$c/obj - -$c_LIBRARY_OBJS := $($c_OBJDIR)/dummy.o - -# FIXME: We do have crtbegin/crtend here so global ctors do not work! -# Either build libm after libgcc or include a private version of crtbegin/crtend. -$c_LDFLAGS := -nostdlib - -$c_TARGETS := clean-$c install-$c $($c_BINDIR)/libm.so - -.PHONY: all-$c install-$c - -all-$c: $($c_BINDIR)/libm.so - -clean-$c: - rm -f $($c_BINDIR)/libm.so - -$($c_OBJDIR) $($c_BINDIR): - mkdir -p $@ - -$($c_OBJDIR)/%.o: $($c_SRCDIR)/%.cpp | $($c_OBJDIR) - x86_64-managarm-g++ -c -o $@ $< - -$($c_BINDIR)/libm.so: $($c_LIBRARY_OBJS) | $($c_BINDIR) - x86_64-managarm-g++ -shared -o $@ $($c_LDFLAGS) $($c_LIBRARY_OBJS) - -install-$c: - mkdir -p $(SYSROOT_PATH)/usr/lib - install $($c_BINDIR)/libm.so $(SYSROOT_PATH)/usr/lib - diff --git a/libpthread/dir.makefile b/libpthread/dir.makefile deleted file mode 100644 index c15db25b..00000000 --- a/libpthread/dir.makefile +++ /dev/null @@ -1,33 +0,0 @@ - -$c_SRCDIR := $(TREE_PATH)/$c/src -$c_BINDIR := $(BUILD_PATH)/$c/bin -$c_OBJDIR := $(BUILD_PATH)/$c/obj - -$c_LIBRARY_OBJS := $($c_OBJDIR)/dummy.o - -# FIXME: We do have crtbegin/crtend here so global ctors do not work! -# Either build libpthread after libgcc or include a private version of crtbegin/crtend. -$c_LDFLAGS := -nostdlib - -$c_TARGETS := clean-$c install-$c $($c_BINDIR)/libpthread.so - -.PHONY: all-$c install-$c - -all-$c: $($c_BINDIR)/libpthread.so - -clean-$c: - rm -f $($c_BINDIR)/libpthread.so - -$($c_OBJDIR) $($c_BINDIR): - mkdir -p $@ - -$($c_OBJDIR)/%.o: $($c_SRCDIR)/%.cpp | $($c_OBJDIR) - x86_64-managarm-g++ -c -o $@ $< - -$($c_BINDIR)/libpthread.so: $($c_LIBRARY_OBJS) | $($c_BINDIR) - x86_64-managarm-g++ -shared -o $@ $($c_LDFLAGS) $($c_LIBRARY_OBJS) - -install-$c: - mkdir -p $(SYSROOT_PATH)/usr/lib - install $($c_BINDIR)/libpthread.so $(SYSROOT_PATH)/usr/lib - diff --git a/librt/dir.makefile b/librt/dir.makefile deleted file mode 100644 index 029d1934..00000000 --- a/librt/dir.makefile +++ /dev/null @@ -1,33 +0,0 @@ - -$c_SRCDIR := $(TREE_PATH)/$c/src -$c_BINDIR := $(BUILD_PATH)/$c/bin -$c_OBJDIR := $(BUILD_PATH)/$c/obj - -$c_LIBRARY_OBJS := $($c_OBJDIR)/dummy.o - -# FIXME: We do have crtbegin/crtend here so global ctors do not work! -# Either build librt after libgcc or include a private version of crtbegin/crtend. -$c_LDFLAGS := -nostdlib - -$c_TARGETS := clean-$c install-$c $($c_BINDIR)/librt.so - -.PHONY: all-$c install-$c - -all-$c: $($c_BINDIR)/librt.so - -clean-$c: - rm -f $($c_BINDIR)/librt.so - -$($c_OBJDIR) $($c_BINDIR): - mkdir -p $@ - -$($c_OBJDIR)/%.o: $($c_SRCDIR)/%.cpp | $($c_OBJDIR) - x86_64-managarm-g++ -c -o $@ $< - -$($c_BINDIR)/librt.so: $($c_LIBRARY_OBJS) | $($c_BINDIR) - x86_64-managarm-g++ -shared -o $@ $($c_LDFLAGS) $($c_LIBRARY_OBJS) - -install-$c: - mkdir -p $(SYSROOT_PATH)/usr/lib - install $($c_BINDIR)/librt.so $(SYSROOT_PATH)/usr/lib - diff --git a/libutil/dir.makefile b/libutil/dir.makefile deleted file mode 100644 index 14185570..00000000 --- a/libutil/dir.makefile +++ /dev/null @@ -1,33 +0,0 @@ - -$c_SRCDIR := $(TREE_PATH)/$c/src -$c_BINDIR := $(BUILD_PATH)/$c/bin -$c_OBJDIR := $(BUILD_PATH)/$c/obj - -$c_LIBRARY_OBJS := $($c_OBJDIR)/dummy.o - -# FIXME: We do have crtbegin/crtend here so global ctors do not work! -# Either build libutil after libgcc or include a private version of crtbegin/crtend. -$c_LDFLAGS := -nostdlib - -$c_TARGETS := clean-$c install-$c $($c_BINDIR)/libutil.so - -.PHONY: all-$c install-$c - -all-$c: $($c_BINDIR)/libutil.so - -clean-$c: - rm -f $($c_BINDIR)/libutil.so - -$($c_OBJDIR) $($c_BINDIR): - mkdir -p $@ - -$($c_OBJDIR)/%.o: $($c_SRCDIR)/%.cpp | $($c_OBJDIR) - x86_64-managarm-g++ -c -o $@ $< - -$($c_BINDIR)/libutil.so: $($c_LIBRARY_OBJS) | $($c_BINDIR) - x86_64-managarm-g++ -shared -o $@ $($c_LDFLAGS) $($c_LIBRARY_OBJS) - -install-$c: - mkdir -p $(SYSROOT_PATH)/usr/lib - install $($c_BINDIR)/libutil.so $(SYSROOT_PATH)/usr/lib - diff --git a/rules.makefile b/rules.makefile deleted file mode 100644 index eebf75eb..00000000 --- a/rules.makefile +++ /dev/null @@ -1,15 +0,0 @@ - -s := -c := -DIRECTORIES := - -define include_dir_aux -c := $1 -DIRECTORIES += $1 -include $(TREE_PATH)/$1/dir.makefile -$$($1_TARGETS): c := $1 -c := $c -endef - -include_dir = $(eval $(call include_dir_aux,$1)) - diff --git a/toplevel.makefile b/toplevel.makefile deleted file mode 100644 index 81014a9b..00000000 --- a/toplevel.makefile +++ /dev/null @@ -1,25 +0,0 @@ - -.DEFAULT_GOAL = all - -PROTOC ?= protoc - -include $(TREE_PATH)/rules.makefile -include $(TREE_PATH)/libc.makefile -$(call include_dir,libdl) -$(call include_dir,libm) -$(call include_dir,libpthread) -$(call include_dir,librt) -$(call include_dir,libutil) - -.PHONY: all clean gen install install-headers - -all: libc.so all-libdl all-libm all-libpthread all-librt all-libutil - -#clean: clean-libc - -gen: gen-libc - -install: install-libc install-libdl install-libm install-libpthread install-librt install-libutil - -install-headers: install-headers-libc -