--- Makefile.in.orig	2022-09-26 19:30:30 UTC
+++ Makefile.in
@@ -25,6 +25,7 @@ systemdsystemunitdir = @systemdsystemunitdir@
 curl_LIBS = @curl_LIBS@
 sqlite_LIBS = @sqlite_LIBS@
 notify_LIBS = @notify_LIBS@
+inotify_LIBS = @inotify_LIBS@
 COMPLETIONS = @COMPLETIONS@
 BASH_COMPLETION_DIR = @BASH_COMPLETION_DIR@
 ZSH_COMPLETION_DIR = @ZSH_COMPLETION_DIR@
@@ -67,6 +68,7 @@ endif
 
 SOURCES = \
 	src/config.d \
+	src/freebsd_inotify.d \
 	src/itemdb.d \
 	src/log.d \
 	src/main.d \
@@ -103,14 +105,15 @@ onedrive: $(SOURCES)
 	else \
 		echo $(version) > version ; \
 	fi
-	$(DC) $(DCFLAGS) $(addprefix -L,$(curl_LIBS)) $(addprefix -L,$(sqlite_LIBS)) $(addprefix -L,$(notify_LIBS)) -L-ldl $(SOURCES) -of$@
+	$(DC) $(DCFLAGS) $(addprefix -L,$(curl_LIBS)) $(addprefix -L,$(sqlite_LIBS)) $(addprefix -L,$(notify_LIBS)) -$(addprefix -L,$(inotify_LIBS)) -L-ldl $(SOURCES) -of$@
 
 install: all
-	$(INSTALL) -D onedrive $(DESTDIR)$(bindir)/onedrive
-	$(INSTALL) -D -m 0644 onedrive.1 $(DESTDIR)$(mandir)/man1/onedrive.1
-	$(INSTALL) -D -m 0644 contrib/logrotate/onedrive.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/onedrive
+	$(INSTALL) -s onedrive $(DESTDIR)$(bindir)/onedrive
+	$(INSTALL) -m 0644 onedrive.1 $(DESTDIR)$(mandir)/man1/onedrive.1
+	mkdir -p $(DESTDIR)$(sysconfdir)/logrotate.d
+	$(INSTALL) -m 0644 contrib/logrotate/onedrive.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/onedrive
 	mkdir -p $(DESTDIR)$(docdir)
-	$(INSTALL) -D -m 0644 $(DOCFILES) $(DESTDIR)$(docdir)
+	$(INSTALL) -m 0644 $(DOCFILES) $(DESTDIR)$(docdir)
 ifeq ($(HAVE_SYSTEMD),yes)
 	$(INSTALL) -d -m 0755 $(DESTDIR)$(systemduserunitdir) $(DESTDIR)$(systemdsystemunitdir)
 ifeq ($(RHEL),1)
@@ -127,9 +130,12 @@ ifeq ($(RHEL_VERSION),6)
 endif
 endif
 ifeq ($(COMPLETIONS),yes)
-	$(INSTALL) -D -m 0644 contrib/completions/complete.zsh $(DESTDIR)$(ZSH_COMPLETION_DIR)/_onedrive
-	$(INSTALL) -D -m 0644 contrib/completions/complete.bash $(DESTDIR)$(BASH_COMPLETION_DIR)/onedrive
-	$(INSTALL) -D -m 0644 contrib/completions/complete.fish $(DESTDIR)$(FISH_COMPLETION_DIR)/onedrive.fish
+	mkdir -p $(DESTDIR)$(ZSH_COMPLETION_DIR)
+	$(INSTALL) -m 0644 contrib/completions/complete.zsh $(DESTDIR)$(ZSH_COMPLETION_DIR)/_onedrive
+	mkdir -p $(DESTDIR)$(BASH_COMPLETION_DIR)
+	$(INSTALL) -m 0644 contrib/completions/complete.bash $(DESTDIR)$(BASH_COMPLETION_DIR)/onedrive
+	mkdir -p $(DESTDIR)$(FISH_COMPLETION_DIR)
+	$(INSTALL) -m 0644 contrib/completions/complete.fish $(DESTDIR)$(FISH_COMPLETION_DIR)/onedrive.fish
 endif
 
 
