Updated WolframAutomata to be C89 compliant.
[screensavers] / hacks / WolframAutomata / Makefile
CommitLineData
bd238daa
AT
1#############################################################
2# (c) 2021 Aaron Taylor <ataylor at subgeniuskitty dot com> #
3# See LICENSE.txt file for copyright and license details. #
4#############################################################
5
6
7################################################################################
8# Configuration
9################################################################################
10
11# The below settings work on FreeBSD. Other UNIX-like systems should only
12# require minor tweaks (e.g. LIB_PATH on Debian should be /usr/lib/ rather than
13# /usr/local/lib/ and the compiler is gcc rather than cc).
14CC = cc
c9e09490 15CC_FLAGS = -Wall -pedantic -std=c89
bd238daa
AT
16INC_PATH = -I../../screenhack/ -I/usr/local/include/
17LIB_PATH = -L/usr/local/lib/
18LIBS = -lm -lX11 -lXt
19
c9e09490
AT
20# Many of the X-related header files contain named variadic macros. Suppress
21# that warning so that we can enable -pedantic C89 compliance for our own code.
22CC_FLAGS += -Wno-variadic-macros
23
bd238daa
AT
24# These flags are normally set in config.h which is generated by the autoconf
25# script as the initial step of the xscreensaver build process. The flags
26# enable/disable code in the various screenhack library files. When compiling
27# elsewhere than FreeBSD, these flags will likely need to be changed. If
28# you're having trouble determing the correct flags to use, try running
29# './configure' in an xscreensaver source tree and examining the generated
30# config.h file.
31DEFINES = -DGETTIMEOFDAY_TWO_ARGS -DHAVE_UNISTD_H
32
33# Since we're only building standalone hacks (i.e. building outside the
34# xscreensaver tree/process) for testing and will later integrate them into the
35# xscreensaver source tree, for now we simply slurp up all the C files that
36# comprise the screenhack library and link them directly into the binary.
37SCREENHACK_SRC != ls -1 ../../screenhack/*.c
38
39################################################################################
40# Targets
41################################################################################
42
43all:
44 @$(CC) $(CC_FLAGS) $(DEFINES) $(INC_PATH) $(LIB_PATH) $(LIBS) -o WolframAutomata WolframAutomata.c $(SCREENHACK_SRC)
45
46clean:
47 @rm -f WolframAutomata WolframAutomata.core
48
49run: clean all
50 @echo ""
51 @echo "######################"
52 @echo "# Press 'q' to exit. #"
53 @echo "######################"
54 @echo ""
55 @./WolframAutomata