diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2016-09-21 23:54:18 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@virtuozzo.com> | 2017-03-14 23:58:09 +0300 |
commit | 3b0c8dbd4837e2a8b7bfb656b433b7fd6c7523b5 (patch) | |
tree | e94f7b027aa841da81cc96d76438c1df8c06f4ee /Makefile.compel | |
parent | 596767d5f7540f3b93e4320062f37de6f76c2017 (diff) |
compel: Reshuffle the directories structure
Here we rather suffle source code into directories
preparing ground for future work.
Basically all this files movements should end up in the
following compel/ tree structure
compel/
├── arch
│ ├── aarch64
│ │ ├── plugins
│ │ │ └── std
│ │ └── src
│ │ └── lib
│ ├── arm
...
│ ├── ppc64
...
│ └── x86
...
This is architectural part, where each arch consists of
plugins/, and src/. src/ stands for code needed by compel
cli + lib
├── include
│ ├── compiler.h -> ../../criu/include/compiler.h
│ ├── elf32-types.h
│ ├── elf64-types.h
│ ├── int.h -> ../../criu/include/asm-generic/int.h
│ ├── piegen.h
│ ├── shmem.h
│ └── uapi
│ ├── compel.h
│ └── plugins.h
Common includes + uapi
├── plugins
│ ├── fds
│ ├── shmem
│ └── std
Plugins source code
└── src
├── lib
│ ├── handle-elf-32.c -> handle-elf.c
│ ├── handle-elf-32-host.c -> handle-elf-32.c
│ ├── handle-elf.c
│ └── handle-elf-host.c -> handle-elf.c
compel library
├── main.c
├── main-host.c -> main.c
compel cli
└── shared
└── fds.c
shared code between plugins and compel cli
Note: cross-compile won't work for a while.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Diffstat (limited to 'Makefile.compel')
-rw-r--r-- | Makefile.compel | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile.compel b/Makefile.compel new file mode 100644 index 000000000..dd60defbf --- /dev/null +++ b/Makefile.compel @@ -0,0 +1,35 @@ +COMPEL_VERSION_HEADER := compel/include/version.h + +$(COMPEL_VERSION_HEADER): $(SRC_DIR)/Makefile.versions + $(call msg-gen, $(COMPEL_VERSION_HEADER)) + $(E) " GEN " $@ + $(Q) echo "/* Autogenerated, do not edit */" > $(COMPEL_VERSION_HEADER) + $(Q) echo "#ifndef COMPEL_SO_VERSION_H__" >> $(COMPEL_VERSION_HEADER) + $(Q) echo "#define COMPEL_SO_VERSION_H__" >> $(COMPEL_VERSION_HEADER) + $(Q) echo "#define COMPEL_SO_VERSION \"$(COMPEL_SO_VERSION)\"" >> $(COMPEL_VERSION_HEADER) + $(Q) echo "#define COMPEL_SO_VERSION_MAJOR " $(COMPEL_SO_VERSION_MAJOR) >> $(COMPEL_VERSION_HEADER) + $(Q) echo "#define COMPEL_SO_VERSION_MINOR " $(COMPEL_SO_VERSION_MINOR) >> $(COMPEL_VERSION_HEADER) + $(Q) echo "#define COMPEL_SO_VERSION_SUBLEVEL " $(COMPEL_SO_VERSION_SUBLEVEL) >> $(COMPEL_VERSION_HEADER) + $(Q) echo "#endif /* COMPEL_SO_VERSION_H__ */" >> $(COMPEL_VERSION_HEADER) + +# +# Compel itself. +compel/%: $(COMPEL_VERSION_HEADER) $(CONFIG_HEADER) .FORCE + $(Q) $(MAKE) $(build)=compel $@ + +# +# Plugins +compel/plugins/%: $(COMPEL_VERSION_HEADER) $(CONFIG_HEADER) .FORCE + $(Q) $(MAKE) $(build)=compel/plugins $@ + +compel/compel: compel/built-in.o compel/lib.a $(COMPEL_VERSION_HEADER) + $(call msg-link, $@) + $(Q) $(CC) $(CFLAGS) $^ $(WRAPFLAGS) $(LDFLAGS) -rdynamic -o $@ + +# +# And compel library. +LIBCOMPEL_SO := libcompel.so +LIBCOMPEL_SO_CFLAGS += $(CFLAGS) -rdynamic -Wl,-soname,$(LIBCOMPEL_SO).$(COMPEL_SO_VERSION_MAJOR) +compel/$(LIBCOMPEL_SO): compel/lib.a + $(call msg-link, $@) + $(Q) $(CC) -shared $(LIBCOMPEL_SO_CFLAGS) -o $@ -Wl,--whole-archive $^ -Wl,--no-whole-archive $(LDFLAGS) |