# Makefile for linux gcc
# "gcc --version" produces version message
#
SWITCHES=-c -I.
SRC=../src
CC=gcc -Os -fno-builtin -fno-strength-reduce -fomit-frame-pointer -finline-functions
v.exe: pietmp.o piesetup.h pie.h pieproto.h pietmp.c pihelpbu.exe
	$(CC) -s pietmp.o -o v.exe -lm
	$(CC) -s -o pihelpbu.exe pihelpbu.c
	rm -f pietmp.o pietmp.c pie.h pieproto.h
	ls -l v.exe pihelpbu.exe
pietmp.o: pie.h pieproto.h pietmp.c
	$(CC) $(SWITCHES) pietmp.c
pietmp.c: $(SRC)/pie.c
	cp -p $(SRC)/pie.c ./pietmp.c
pie.h: $(SRC)/pie.h
	cp -p $(SRC)/pie.h ./pie.h
pieproto.h: $(SRC)/pieproto.h
	cp -p $(SRC)/pieproto.h ./pieproto.h
pihelpbu.exe: pihelpbu.c
	$(CC) -s -o pihelpbu.exe pihelpbu.c
	rm -f pihelpbu.o
clean: v.exe pihelpbu.exe
	rm -f v.exe pihelpbu.exe
