# Copyright 2021 by COG9 LLC
# All rights reserved
# Title: Makefile
# Author: Jed Marti
# Description: Generic Makefile for Windows and Linux. Uncomment the system you want.


# Linux 64 style.
CC = cc
CFLAGS = -Ofast
EXE =
O = o
RM = rm -rf
CP = cp
BIN = /usr/local/bin
LFLAGS = -lm

# Windows GCC - uncomment the next lines for GCC - tested with Windows 11.
#CC = gcc
#CFLAGS = -O1 -DWINDOWS
#EXE = .exe
#O = o
#RM = del
#CP = copy
#BIN = /local
#LFLAGS = -lm
#DEL = del

OBJS =	readcaps.$(O) \
	solutions.$(O) \
	utils.$(O)

all:	$(OBJS) caps$(EXE) fastgen$(EXE)

# Clean up before saving.
clean:
	$(RM) a.out
	$(RM) *.$(O)
	$(RM) \#*

# Install
install:
	$(CP) caps $(BIN)
	$(CP) fastgen $(BIN)

# **A**
# **B**
# **C**
# **D**
# **E**
# **F**
# **G**
# **H**
# **I**
# **J**
# **L**
# **M**
# **N**
# **O**
# **P**
# **Q**
# **R**
readcaps.$(O):	caps.h readcaps.c

# **S**
solutions.$(O):	caps.h solutions.c

# **T**
# **U**
utils.$(O):	caps.h utils.c

# **V**
# **W**
# The main program.
caps$(EXE):	$(OBJS) caps.$(O)
	$(CC) -c caps.c $(CFLAGS)
	$(CC) -o caps$(EX) caps.$(O) $(OBJS) $(LFLAGS)

# Generate permutations.
fastgen$(EXE):	fastgen.$(O)
	$(CC) -c fastgen.c $(CFLAGS) 
	$(CC) -o fastgen$(EXE) fastgen.$(O) $(LFLAGS)


