• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ################################################################
2# Copyright (c) 2019-present, Facebook, Inc.
3# All rights reserved.
4#
5# This source code is licensed under both the BSD-style license (found in the
6# LICENSE file in the root directory of this source tree) and the GPLv2 (found
7# in the COPYING file in the root directory of this source tree).
8# ################################################################
9
10.PHONY: all
11all: recover_directory
12
13ZSTDLIBDIR ?= ../../lib
14PROGRAMDIR ?= ../../programs
15
16CFLAGS     ?= -O3
17CFLAGS     += -I$(ZSTDLIBDIR) -I$(PROGRAMDIR)
18CFLAGS     += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow                 \
19              -Wstrict-aliasing=1 -Wswitch-enum                               \
20              -Wstrict-prototypes -Wundef                                     \
21              -Wvla -Wformat=2 -Winit-self -Wfloat-equal -Wwrite-strings      \
22              -Wredundant-decls -Wmissing-prototypes
23CFLAGS     += $(DEBUGFLAGS) $(MOREFLAGS)
24FLAGS       = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
25
26.PHONY: $(ZSTDLIBDIR)/libzstd.a
27$(ZSTDLIBDIR)/libzstd.a:
28	$(MAKE) -C $(ZSTDLIBDIR) libzstd.a
29
30recover_directory: recover_directory.c $(ZSTDLIBDIR)/libzstd.a $(PROGRAMDIR)/util.c
31	$(CC) $(FLAGS) $^ -o $@$(EXT)
32
33.PHONY: clean
34clean:
35	rm -f recover_directory
36