1# This is a makefile for mingw32.  See mkfiles/README for other compilers.
2#
3CC		= gcc
4CFLAGS		= -W -Wall -O2
5COPY		= cp
6SLCONFIG_H	= ../src/slconfig.h
7#---------------------------------------------------------------------------
8# Installation location of the slang library
9#---------------------------------------------------------------------------
10SLANG_INC	= -I../src
11SLANG_LIB	= -L../src/gw32objs -lslang
12#----------------------------------------------------------------------------
13# Installation location of lib/slsh.rc and lib/*.sl
14#----------------------------------------------------------------------------
15COPY = cp
16MKDIR = mkdir
17SLSH_CONF_DIR	= C:/slsh
18SLSH_LIB_DIR	= C:/slsh
19#----------------------------------------------------------------------------
20# End of user configuration
21#----------------------------------------------------------------------------
22LIBS = $(RPATH) $(SLANG_LIB) $(DL_LIB) -lm
23#DEFS = -DSLSH_CONF_DIR='"$(SLSH_CONF_DIR)"' -DSLSH_PATH='"$(SLSH_LIB_DIR)"'
24
25all: slsh.exe
26slsh.exe: slsh.o readline.o
27	$(CC) slsh.o readline.o -o slsh.exe $(LIBS)
28slsh.o: slsh.c slsh.h config.h
29	$(CC) -c $(CFLAGS) $(SLANG_INC) $(DEFS) slsh.c
30readline.o: readline.c slsh.h config.h
31	$(CC) -c $(CFLAGS) $(SLANG_INC) $(DEFS) readline.c
32config.h: ../src/config.h
33	$(COPY) $(SLCONFIG_H) config.h
34install: slsh
35	-$(MKDIR) $(SLSH_CONF_DIR)
36	-$(MKDIR) $(SLSH_LIB_DIR)
37	$(COPY) lib/*.sl $(SLSH_LIB_DIR)
38	$(COPY) lib/slsh.rc $(SLSH_CONF_DIR)
39