# Makefile
#
# for Tessera
#
# by Spyros Paraschis
#

# Variables to control internal rules:

CC = gcc
CFLAGS = -Wall -mpentium -O2 -funroll-loops -ffast-math

TARGET_ARCH = -s
LDLIBS = -mwindows -l2xsai -lalleg


# Variables:

SRCS = main.c common.c menu.c game.c c4.c dirty.c
OBJS = $(patsubst %.c,%.o,$(SRCS)) icon.o
EXE = tessera.exe


# Phony targets:

.PHONY: all clean deps


# All:

all: $(EXE)


# How to make the executable:

$(EXE): $(OBJS)
	$(LINK.o) $^ $(LDLIBS) $(LOADLIBES) -o $@


# How to make the object files:

-include deps.mak

# (deps.mak is generated by `make deps' as below)


# Dependencies:

deps:
	gcc -MM $(SRCS) > deps.mak

icon.o:
	windres -i tessera.rc -o icon.o


# Cleaning target (only works with fileutils):

clean:
	del *.o


