Fixed compatibility of Makefile with older make versions.
This commit is contained in:
parent
d988fd0a56
commit
e4d9fc9162
27
Makefile
27
Makefile
@ -25,8 +25,6 @@ SUBDIR_LIB := libslunkcrypt
|
|||||||
# Flags
|
# Flags
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
CONFIG =
|
|
||||||
LDFLGS =
|
|
||||||
CFLAGS = -I$(SUBDIR_LIB)/include -std=gnu99 -Wall -pedantic
|
CFLAGS = -I$(SUBDIR_LIB)/include -std=gnu99 -Wall -pedantic
|
||||||
|
|
||||||
ifneq (,$(firstword $(filter 32 64,$(CPU))))
|
ifneq (,$(firstword $(filter 32 64,$(CPU))))
|
||||||
@ -47,17 +45,19 @@ endif
|
|||||||
ifneq ($(ASAN),0)
|
ifneq ($(ASAN),0)
|
||||||
CONFIG := _a
|
CONFIG := _a
|
||||||
CFLAGS += -O1 -g -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
CFLAGS += -O1 -g -fsanitize=address -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
||||||
else ifneq ($(DEBUG),0)
|
else
|
||||||
|
ifneq ($(DEBUG),0)
|
||||||
CONFIG := _g
|
CONFIG := _g
|
||||||
CFLAGS += -Og -g
|
CFLAGS += -Og -g
|
||||||
else
|
else
|
||||||
CFLAGS += -O3 -DNDEBUG
|
CFLAGS += -O3 -DNDEBUG
|
||||||
ifneq ($(FLTO),0)
|
ifneq ($(FLTO),0)
|
||||||
CFLAGS += -flto
|
CFLAGS += -flto
|
||||||
endif
|
endif
|
||||||
ifneq ($(FPGO),0)
|
ifneq ($(FPGO),0)
|
||||||
CFLAGS += -fprofile-$(firstword $(FPGO))
|
CFLAGS += -fprofile-$(firstword $(FPGO))
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
ifneq ($(NALYZE),0)
|
ifneq ($(NALYZE),0)
|
||||||
CFLAGS += -fanalyzer
|
CFLAGS += -fanalyzer
|
||||||
@ -71,9 +71,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(firstword $(filter %mingw32 %-windows-gnu %-cygwin %-cygnus,$(MACHINE))))
|
ifneq (,$(firstword $(filter %mingw32 %-windows-gnu %-cygwin %-cygnus,$(MACHINE))))
|
||||||
SUFFIX := .exe
|
EXE_SUFFIX := .exe
|
||||||
else
|
|
||||||
SUFFIX :=
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(firstword $(filter %-w64-mingw32 %w64-windows-gnu,$(MACHINE))))
|
ifneq (,$(firstword $(filter %-w64-mingw32 %w64-windows-gnu,$(MACHINE))))
|
||||||
@ -102,7 +100,7 @@ endif
|
|||||||
# File names
|
# File names
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
OUTNAME_APP := slunkcrypt$(CONFIG)$(SUFFIX)
|
OUTNAME_APP := slunkcrypt$(CONFIG)$(EXE_SUFFIX)
|
||||||
OUTNAME_LIB := libslunkcrypt$(CONFIG)-1.a
|
OUTNAME_LIB := libslunkcrypt$(CONFIG)-1.a
|
||||||
|
|
||||||
OUTPATH_APP := $(SUBDIR_APP)/bin/$(OUTNAME_APP)
|
OUTPATH_APP := $(SUBDIR_APP)/bin/$(OUTNAME_APP)
|
||||||
@ -148,6 +146,5 @@ $(SUBDIR_LIB)/obj/%$(CONFIG).o: $(SUBDIR_LIB)/src/%.c
|
|||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) $(SUBDIR_APP)/obj/*.o $(SUBDIR_APP)/obj/*.gcda $(SUBDIR_APP)/lib/*.a $(SUBDIR_APP)/bin/*$(SUFFIX)
|
$(RM) $(SUBDIR_APP)/obj/*.o $(SUBDIR_APP)/obj/*.gcda $(SUBDIR_APP)/lib/*.a $(SUBDIR_APP)/bin/*$(EXE_SUFFIX)
|
||||||
$(RM) $(SUBDIR_LIB)/obj/*.o $(SUBDIR_LIB)/obj/*.gcda $(SUBDIR_LIB)/lib/*.a $(SUBDIR_LIB)/bin/*$(SUFFIX)
|
$(RM) $(SUBDIR_LIB)/obj/*.o $(SUBDIR_LIB)/obj/*.gcda $(SUBDIR_LIB)/lib/*.a $(SUBDIR_LIB)/bin/*$(EXE_SUFFIX)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user