6 # ----------------------------------------------------------------------------
8 # ----------------------------------------------------------------------------
10 OS_TYPE
:= $(shell $(CC
) -dumpmachine
)
13 CFLAGS
+= -target
$(TARGET
)
17 CFLAGS
+= --sysroot
=$(SYSROOT
)
24 CFLAGS
+= -std
=gnu99
-Wall
-pedantic
-Wno-deprecated-declarations
-Ilibnuhash
/c99
/include -D_FILE_OFFSET_BITS
=64
27 CFLAGS
+= -Ofast
-DNDEBUG
37 CFLAGS
+= -march
=$(MARCH
)
41 CFLAGS
+= -mtune
=$(MTUNE
)
52 ifneq ($(filter %w64-mingw32
%w64-windows-gnu
,$(OS_TYPE
)),)
56 RCFLAGS
+= -Ilibnuhash
/c99
/src
58 # ----------------------------------------------------------------------------
60 # ----------------------------------------------------------------------------
62 INFILES
= $(patsubst %.c
,%.o
,$(wildcard libnuhash
/c99
/src
/*.c
)) $(patsubst %.c
,%.o
,$(wildcard tool
/src
/*.c
))
64 OUTPATH
= $(patsubst %/,%,$(dir $(OUTFILE
)))
66 ifneq ($(filter %mingw32
%windows-gnu
%cygwin
%cygnus
,$(OS_TYPE
)),)
67 OUTFILE
:= $(OUTFILE
).exe
70 ifneq ($(filter %mingw32
%windows-gnu
%cygwin
%cygnus
,$(OS_TYPE
)),)
71 INFILES
+= $(patsubst %.rc
,%.o
,$(wildcard tool
/res
/*.rc
))
74 # ----------------------------------------------------------------------------
76 # ----------------------------------------------------------------------------
82 $(OUTFILE
): $(INFILES
) |
$(OUTPATH
)
83 $(CC
) $(CFLAGS
) -o
$@
$^
$(LDFLAGS
)
89 $(CC
) $(CFLAGS
) -c
-o
$@
$<
92 windres
$(RCFLAGS
) -o
$@
$<
96 find . \
! -path
'*/.*' -type f
-name
'*.o' -exec
rm -vf
{} \
;