Note: I chose to install into sbin/kresc, just as with the C implementation.
doc: doc-html
.PHONY: all install check clean doc info
-#FIXME: implement these
-.PHONY: client client-install client-clean
-
# Options
ifdef COVERAGE
BUILD_CFLAGS += --coverage
$(error "Unable to resolve libknot_SONAME, update find_soname in platform.mk")
endif
ifeq ($(libzscanner_SONAME),)
- $(error "Unable to resolve libzscanner_SONAME, update find_some in platform.mk")
+ $(error "Unable to resolve libzscanner_SONAME, update find_soname in platform.mk")
endif
# Find Go version and platform
-client_SOURCES := kresc.lua
-client:
- # Install luarocks modules because I do not know how to do it properly
- luarocks install ljlinenoise --local;
+client: client/kresc
+ @# Install luarocks modules because I do not know how to do it properly
+ @# TODO: try to detect this somehow
+ @echo "make sure ljlinenoise is installed, e.g. via:"
+ @echo "$ luarocks install ljlinenoise --local"
-client/kresc.lua: client/kresc.lua.in
+client/kresc: client/kresc.lua.in
@$(call quiet,SED,$<) -e "s/@libkres_SONAME@/$(libkres_SONAME)/" $< > $@
-
+
+client-install: client
+ $(INSTALL) -D client/kresc $(DESTDIR)$(SBINDIR)
+
client-clean:
- @$(call quiet,RM,modules/version/version.lua) client/client.lua
\ No newline at end of file
+ @$(call quiet,RM,client/kresc) client/kresc
+
+.PHONY: client client-install client-clean
+
int kr_init_tty(const char *path);
char *kr_run_cmd(const char *cmd, size_t * out_len);
]]
- kresc = ffi.load(@libkres_SONAME@) -- FIXME in makefile
+ kresc = ffi.load('@libkres_SONAME@')
kresc.kr_init_tty(arg[1])
end
//! Initialize connection to the daemon; return 0 on success.
KR_EXPORT int kr_init_tty(const char *path)
{
+ if (!path)
+ return 1;
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd < 0)
return 1;
$(eval $(call make_lib,libkres,lib,yes,$(ABIVER)))
endif
+libkres_SONAME := libkres$(call SOVER_EXT,$(ABIVER))
+
# Generate pkg-config file
libkres.pc:
@echo 'prefix='$(PREFIX) > $@