src = $(wildcard src/*.c) $(wildcard src/dos/*.c) ssrc = $(wildcard src/*.s) sinlut.s obj = $(src:.c=.odj) $(ssrc:.s=.odj) dep = $(src:.c=.d) coff = rbench bin = $(coff).exe bin0 = $(coff)0.exe ifeq ($(findstring COMMAND.COM, $(SHELL)), COMMAND.COM) host = dos LUTGEN = tools/lutgen.exe else host = unix TC = i586-pc-msdosdjgpp- LUTGEN = tools/lutgen endif CC = $(TC)gcc AS = $(TC)as warn = -pedantic -Wall -Wno-deprecated-declarations dbg = -g opt = -O3 -ffast-math -fno-strict-aliasing inc = -Isrc def = -DNO_STDINT_H CFLAGS = $(warn) $(dbg) $(opt) $(def) $(inc) -MMD LDFLAGS = -Wl,-Map=link.map $(bin): $(obj) $(CC) -o $@ $(obj) $(LDFLAGS) $(bin0): $(bin) exe2coff $< copy /b \djgpp\bin\cwsdstr0.exe+$(coff) $@ sinlut.s: $(LUTGEN) $(LUTGEN) >$@ -include $(dep) -include *.d %.odj: %.c $(CC) -o $@ $(CFLAGS) -c $< %.odj: %.s $(AS) -o $@ $(ASFLAGS) $< ifeq ($(host), dos) .PHONY: clean clean: del src\*.odj del src\dos\*.odj del *.odj del $(bin) del sinlut.s .PHONY: cleandep cleandep: del src\*.d del src\dos\*.d del *.d else .PHONY: clean clean: rm -f $(obj) $(bin) .PHONY: clean cleandep: rm -f $(dep) endif $(LUTGEN): tools/lutgen.c gcc -o $@ $< -lm