# Title: Makefile
# Author: Jed Marti KI7NNP
# Description: Windows/linux build.
# Revision History: (Created Sun Mar 12 10:28:48 2023)


# Windows 10 32 bits using Microsoft C compiler. Assumes you've added the binaries to
#   the search path. Your should run vcvars32.bat before doing any of this. Uncomment the
#   following lines and comment out the linux lines.
#CC = cl
#O = obj
#EXE = .exe
#CFLAGS = /Ox /EHsc /MT /W3 /nologo /c /TC /D "_CONSOLE" /D "_MBCS" /D "WINTEL" /D "_CRT_SECURE_NO_DEPRECATE"
#RM = del /Q
#CP = copy
#BIN = c:\local
#LFLAGS = /link /OPT:REF /SUBSYSTEM:CONSOLE /MACHINE:IX86 kernel32.lib user32.lib 

# Linux. Comment the following out if you're compiling for windows.
CC = cc
O = o
EXE =
CFLAGS = -O2 -c 
RM = rm -rf
CP = cp
BIN = /usr/local/bin
LFLAGS = -lm


all:	coil$(EXE)

# make install - copy the executable to the local place where they go.
install:
	$(CP) coil$(EXE) $(BIN)

# make clean - get rid of stuff you don't need.
clean:
	$(RM) *.$(O)
	$(RM) a.out
	$(RM) coil$(EXE)

# make - create the executable.
coil$(EXE):	coil.c
	$(CC) $(CFLAGS) coil.c
	$(CC) -o coil$(EXE) coil.$(O) $(LFLAGS)
