Blub / netevent

Input-Event device cloning utility. Use it together with ssh/netcat/... to share input devices among different machines.
GNU General Public License v2.0
148 stars 14 forks source link

Support out-of-tree builds #18

Closed domsekotill closed 3 years ago

domsekotill commented 3 years ago

Adds support for building in a directory separate from the source code tree:

mkdir /tmp/build
cd /tmp/build
${path_to_source}/configure
make

Also necessarily includes a commit fixing the issue requiring the following hack in Makefile:

# the src/*.d files contain 'src/../config.h' for this:
src/../config.h: config.h
Blub commented 3 years ago

What I dislike about this is that you keep seeing the mkdir line being repeated for every object.

I think the directory creation should also work like this:

+$(CURDIR)/doc $(CURDIR)/src:
+    mkdir -p $@
+
-$(OBJECTS): Makefile config.h
+$(OBJECTS): Makefile config.h $(CURDIR)/src
+$(MAN1PAGES): $(CURDIR)/doc

This should make sure the directories are created as well (for some reason I could not get it to work without the $(CURDIR)/ prefix though...) Would that work for you?

domsekotill commented 3 years ago

Yes, I could not get it to work which was why I implememented it that way; the $(CURDIR) trick looks interesting, I'll give it a test. Are you OK with me rebasing/squashing?

Blub commented 3 years ago

yeah you can just force-push to update the PR

Blub commented 3 years ago

Thanks!