CRC-64/Makefile

38 lines
758 B
Makefile
Raw Normal View History

2022-09-09 21:21:39 +02:00
MACHINE := $(shell $(CC) -dumpmachine || echo unknown)
2022-09-09 23:12:23 +02:00
ifneq (,$(firstword $(filter x86_64-%,$(MACHINE))))
2022-09-09 21:21:39 +02:00
MARCH ?= x86-64
MTUNE ?= nocona
else
2022-09-09 23:12:23 +02:00
ifneq (,$(firstword $(filter i686-%,$(MACHINE))))
MARCH ?= i586
MTUNE ?= pentium2
endif
2022-09-09 21:21:39 +02:00
endif
2022-09-09 23:12:23 +02:00
CFLAGS = -Wall -std=gnu99 -O3 -DNDEBUG
ifneq (,$(MARCH))
CFLAGS += -march=$(MARCH)
endif
ifneq (,$(MTUNE))
CFLAGS += -mtune=$(MTUNE)
endif
2022-09-09 21:21:39 +02:00
ifneq (,$(firstword $(filter %mingw32 %-windows-gnu %-cygwin %-cygnus,$(MACHINE))))
2022-09-09 23:12:23 +02:00
OUTNAME := crc64.exe
2022-09-09 21:21:39 +02:00
else
2022-09-09 23:12:23 +02:00
OUTNAME := crc64
2022-09-09 21:21:39 +02:00
endif
ifneq (,$(firstword $(filter %-w64-mingw32 %w64-windows-gnu,$(MACHINE))))
CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -mconsole -municode
endif
CFLAGS += -s -static
.PHONY: all
all:
2022-09-09 23:12:23 +02:00
$(CC) $(CFLAGS) -o $(OUTNAME) crc64.c