Added `Makefile` documenting the build commands for greynetic/reference hack.
authorAaron Taylor <ataylor@subgeniuskitty.com>
Wed, 10 Mar 2021 11:09:27 +0000 (03:09 -0800)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Wed, 10 Mar 2021 11:09:27 +0000 (03:09 -0800)
reference/Makefile [new file with mode: 0644]

diff --git a/reference/Makefile b/reference/Makefile
new file mode 100644 (file)
index 0000000..7219996
--- /dev/null
@@ -0,0 +1,48 @@
+################################################################################
+# Configuration
+################################################################################
+
+# The below settings work on FreeBSD. Other UNIX-like systems should only
+# require minor tweaks (e.g. LIB_PATH on Debian should be /usr/lib/ rather than
+# /usr/local/lib/ and the compiler is gcc rather than cc).
+CC       = cc
+CC_FLAGS = -Wall -pedantic
+INC_PATH = -I../screenhack/ -I/usr/local/include/
+LIB_PATH = -L/usr/local/lib/
+LIBS     = -lm -lX11 -lXt
+
+# These flags are normally set in config.h which is generated by the autoconf
+# script as the initial step of the xscreensaver build process. The flags
+# enable/disable code in the various screenhack library files. When compiling
+# elsewhere than FreeBSD, these flags will likely need to be changed.  If
+# you're having trouble determing the correct flags to use, try running
+# './configure' in an xscreensaver source tree and examining the generated
+# config.h file.
+DEFINES  = -DGETTIMEOFDAY_TWO_ARGS -DHAVE_UNISTD_H
+
+# Since we're only building standalone hacks (i.e. building outside the
+# xscreensaver tree/process) for testing and will later integrate them into the
+# xscreensaver source tree, for now we simply slurp up all the C files that
+# comprise the screenhack library and link them directly into the binary.
+SCREENHACK_SRC != ls -1 ../screenhack/*.c
+
+################################################################################
+# Targets
+################################################################################
+
+all:
+       @$(CC) $(CC_FLAGS) $(DEFINES) $(INC_PATH) $(LIB_PATH) $(LIBS) -o greynetic greynetic.c $(SCREENHACK_SRC)
+
+clean:
+       @rm -f greynetic greynetic.core
+
+run: clean all
+       @echo ""
+       @echo "######################"
+       @echo "# Press 'q' to exit. #"
+       @echo "######################"
+       @echo ""
+       @./greynetic
+
+manpage:
+       @mandoc -a greynetic.man