# Makefile for vacall

#### Start of system configuration section. ####

HOST = i386-pc-win32-msvc
CPU = i386

# Directories used by "make":
srcdir = .

# Directories used by "make install":
prefix = /usr/local
local_prefix = /usr/local
exec_prefix = $(prefix)
libdir = $(exec_prefix)/lib
includedir = $(prefix)/include
mandir = $(exec_prefix)/man

# Programs used by "make":
CC = cl
CFLAGS = -O1
CPP = cl -E
INCLUDES = -I. -I$(srcdir)
AR = lib
AR_FLAGS = /out:
MV = mv
LN = cp
RM = del

# Programs used by "make install":
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

#### End of system configuration section. ####

SHELL = /bin/sh

OBJECTS = vacall.obj misc.obj structcpy.obj

all : $(OBJECTS) vacall.lib vacall.h $(srcdir)/vacall.3 $(srcdir)/vacall.html

vacall.h : vacall.h.msvc
	$(RM) vacall.h
	$(LN) vacall.h.msvc vacall.h

config.h : config.h.msvc
	$(RM) config.h
	$(LN) config.h.msvc config.h

vacall.obj : vacall-$(CPU).obj
	$(RM) vacall.obj
	$(LN) vacall-$(CPU).obj vacall.obj

vacall-i386.obj : $(srcdir)/vacall-i386-msvc.c vacall.h
	$(RM) vacall-i386.obj
	$(CC) -c $(srcdir)/vacall-i386-msvc.c /Fovacall-i386.obj

misc.obj : $(srcdir)/misc.c vacall.h config.h
	$(CC) $(CFLAGS) $(INCLUDES) -c $(srcdir)/misc.c

structcpy.obj : $(srcdir)/structcpy.c
	$(CC) $(CFLAGS) -c $(srcdir)/structcpy.c

vacall.lib : $(OBJECTS)
	$(RM) vacall.lib
	$(AR) $(AR_FLAGS)vacall.lib $(OBJECTS)

tests.obj : $(srcdir)/tests.c vacall.h
	$(CC) $(CFLAGS) $(INCLUDES) -c $(srcdir)/tests.c

tests.s : $(srcdir)/tests.c vacall.h
	$(CC) $(CFLAGS) $(INCLUDES) -c $(srcdir)/tests.c /FAs /Fatests.s

tests.exe : tests.obj vacall.lib
	$(CC) $(CFLAGS) tests.obj vacall.lib /Fetests.exe

check : all tests.exe
	tests.exe > tests.out
	uniq -u < tests.out > tests.output.$(HOST)

mostlyclean : clean

clean : force
	$(RM) *.obj *.lib core
	$(RM) vacall-i386.s
	$(RM) tests.obj tests.s tests.exe tests.out

distclean : clean
	$(RM) config.status config.log config.cache Makefile vacall.h config.h tests.output.*

maintainer-clean : distclean

force :

