# Makefile for set6x86, a program to get/set Cyrix 6x86 CPU config settings 
# from Linux or DOS
#
#
# to compile from DOS, use "make dos" instead of just "make"
# DOS version uses the Linux-based DOS cross-compiler "gcc_dos"


CFLAGS = -O2 -Wall

VERSION=1.3

#############################################################################

_VERSION = -DVERSION=\"$(VERSION)\"

std: get6x86 set6x86 6x86_arr 

get6x86: set6x86
	ln -sf set6x86 get6x86

set6x86: set6x86.c
	$(CC) $(CFLAGS) $(_VERSION) -o set6x86 set6x86.c

6x86_arr: 6x86_arr.c
	$(CC) $(CFLAGS) $(_VERSION) -o 6x86_arr 6x86_arr.c

dos: set6x86.c 6x86_arr.c
	gcc-dos -s $(CFLAGS) $(_VERSION) -DDOS -o set6x86.exe set6x86.c
	gcc-dos -s $(CFLAGS) $(_VERSION) -DDOS -o 6x86_arr.exe 6x86_arr.c
	ln -sf set6x86.exe get6x86.exe

all: set6x86 get6x86 6x86_arr dos

clean:
	rm -f get6x86 set6x86 6x86_arr set6x86.exe get6x86.exe 6x86_arr.exe *.o
