summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2017-05-16 18:37:18 -0400
committerFranklin Wei <me@fwei.tk>2017-05-16 18:37:18 -0400
commit19c0e01741fdea40d025ce6e9ae446b981bc8569 (patch)
tree97c8fe5bed776529812f1f65000d9250c5d12da2 /Makefile
parent5cfe979646d99e51cb33ae256538412b1d51994e (diff)
downloadxenonchess-19c0e01741fdea40d025ce6e9ae446b981bc8569.zip
xenonchess-19c0e01741fdea40d025ce6e9ae446b981bc8569.tar.gz
xenonchess-19c0e01741fdea40d025ce6e9ae446b981bc8569.tar.bz2
xenonchess-19c0e01741fdea40d025ce6e9ae446b981bc8569.tar.xz
random words
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..ba65e9e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+PROGRAM_NAME = chessengine
+
+CC = cc
+INSTALL = install
+
+SRC := $(wildcard *.c)
+OBJ := $(SRC:.c=.o)
+
+PREFIX = /usr
+BINDIR = $(PREFIX)/bin
+LIBDIR = $(PREFIX)/lib
+
+INCLUDES =
+LIBS =
+
+HEADERS := $(wildcard *.h)
+
+CFLAGS = -O3 -g -Wall -Wextra -std=gnu99 $(INCLUDES)
+
+all: Makefile $(PROGRAM_NAME)
+
+$(PROGRAM_NAME): Makefile $(OBJ) $(HEADERS)
+ @echo "LD $@"
+ @$(CC) $(OBJ) -o $@ $(CFLAGS) $(LIBS)
+
+%.o: %.c Makefile $(HEADERS)
+ @echo "CC $<"
+ @$(CC) $(CFLAGS) -c $< -o $@
+
+install: all
+ @echo "INSTALL $(PROGRAM_NAME)"
+ @install $(PROGRAM_NAME) $(BINDIR)
+
+clean:
+ @echo "Cleaning build directory..."
+ @rm -f $(OBJ) $(PROGRAM_NAME)