Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ endef
.PHONY: all re clean fclean \
install uninstall \
debug debug_build valgrind \
unit_tests tests_run coverage functional_tests \
unit_tests tests_run coverage functional_tests plugin \
help

all: $(NAME)
Expand Down Expand Up @@ -278,10 +278,24 @@ fclean: clean
$(call pretty_header, Full clean: objects binary tests coverage)
@$(RM) $(NAME) $(TO_RM)
@$(RM) $(LOGS_DIR)/functional_tests
@find ./plugins -type f -name 'lib*.so' -delete
@$(RM) /tmp/test.* /tmp/.shell.* /tmp/.refer.* /tmp/.tester.* /tmp/.runner.* /tmp/.tmp.* test/ dir;
@$(RM) "dir \"" "dir;" test output
@$(MAKE) fclean -C tests/

plugin: all
$(call pretty_header, Building Plugins)
@set -e; \
for plugin_src in $$(find ./plugins -type d -name src | sort); do \
plugin_dir=$$(dirname "$$plugin_src"); \
plugin_name=$$(basename "$$plugin_dir"); \
printf "%b\n" "$(H_CYAN)Building plugin$(END) $(BOLD)$$plugin_name$(END) ..."; \
clang -fPIC -shared $(CFLAGS) \
-I"$$plugin_dir/include" -Iinclude -I"$$plugin_dir/src" \
-o "plugins/lib$$plugin_name.so" \
$$(find "$$plugin_src" -type f -name '*.c' | sort); \
done

re: fclean all

# ─── Help ────────────────────────────────────────────────────────────────
Expand Down
3 changes: 1 addition & 2 deletions plugins/example/crocus/src/crocus.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
** tic-tac-toe.c
*/

#include "../../../include/core/plugins.h"
#include "../../../include/c_zsh.h"
#include "c_zsh.h"
#include "../include/crocus.h"
#include <stdio.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
** hello.c
*/

#include "../include/core/plugins.h"
#include "../include/c_zsh.h"
#include "c_zsh.h"
#include <stdio.h>

static int hello_builtin(main_t *main_stock, command_ctx_t *ctx)
Expand Down