Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
94 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,98 @@ | ||
#################################################################################################################################### | ||
# pgBackRest Makefile | ||
#################################################################################################################################### | ||
|
||
#################################################################################################################################### | ||
# Compile options | ||
#################################################################################################################################### | ||
CC=gcc | ||
CFLAGS=-I. -Wfatal-errors -Wall -Wextra -Wwrite-strings -Wno-clobbered -std=c99 -O2 -funroll-loops -ftree-vectorize \ | ||
`perl -MExtUtils::Embed -e ccopts` | ||
LDFLAGS=`perl -MExtUtils::Embed -e ldopts` | ||
DESTDIR= | ||
|
||
pgbackrest: \ | ||
command/archive/push/push.o \ | ||
command/help/help.o \ | ||
command/command.o \ | ||
common/error.o \ | ||
common/exit.o \ | ||
common/ini.o \ | ||
common/log.o \ | ||
common/memContext.o \ | ||
common/regExp.o \ | ||
common/time.o \ | ||
common/type/buffer.o \ | ||
common/type/keyValue.o \ | ||
common/type/list.o \ | ||
common/type/string.o \ | ||
common/type/stringList.o \ | ||
common/type/variant.o \ | ||
common/type/variantList.o \ | ||
common/wait.o \ | ||
config/config.o \ | ||
config/define.o \ | ||
config/load.o \ | ||
config/parse.o \ | ||
perl/config.o \ | ||
perl/exec.o \ | ||
storage/helper.o \ | ||
storage/storage.o \ | ||
main.o | ||
$(CC) $(CFLAGS) -o pgbackrest \ | ||
command/archive/push/push.o \ | ||
command/help/help.o \ | ||
command/command.o \ | ||
common/error.o \ | ||
common/exit.o \ | ||
common/ini.o \ | ||
common/log.o \ | ||
common/memContext.o \ | ||
common/regExp.o \ | ||
common/time.o \ | ||
common/type/buffer.o \ | ||
common/type/keyValue.o \ | ||
common/type/list.o \ | ||
common/type/string.o \ | ||
common/type/stringList.o \ | ||
common/type/variant.o \ | ||
common/type/variantList.o \ | ||
common/wait.o \ | ||
config/config.o \ | ||
config/define.o \ | ||
config/load.o \ | ||
config/parse.o \ | ||
perl/config.o \ | ||
perl/exec.o \ | ||
storage/helper.o \ | ||
storage/storage.o \ | ||
main.o \ | ||
$(LDFLAGS) | ||
|
||
# Compile using C99 standard | ||
CSTD = -std=c99 | ||
|
||
# Compile optimizations | ||
COPT = -O2 | ||
|
||
# Locations of header files | ||
CINCLUDE = -I. | ||
|
||
# Compile warnings | ||
CWARN = -Wfatal-errors -Wall -Wextra -Wwrite-strings -Wno-clobbered | ||
|
||
# Automatically generate Perl compile options for the local system | ||
CPERL = `perl -MExtUtils::Embed -e ccopts` | ||
|
||
# Extra compile options to be set by caller | ||
CEXTRA = | ||
|
||
# Concatenate options for easy usage | ||
CFLAGS = $(CINCLUDE) $(CSTD) $(COPT) $(CWARN) $(CPERL) $(CEXTRA) | ||
|
||
#################################################################################################################################### | ||
# Link options | ||
#################################################################################################################################### | ||
# Automatically generate Perl linker options for the local system | ||
LDPERL = `perl -MExtUtils::Embed -e ldopts` | ||
|
||
# Extra linker options to be set by caller | ||
LDEXTRA = | ||
|
||
# Concatenate options for easy usage | ||
LDFLAGS = $(LDPERL) $(LDEXTRA) | ||
|
||
#################################################################################################################################### | ||
# Install options | ||
#################################################################################################################################### | ||
# Modify destination install directory | ||
DESTDIR = | ||
|
||
#################################################################################################################################### | ||
# List of required source files. main.c should always be listed last and the rest in alpha order. | ||
#################################################################################################################################### | ||
SRCS = \ | ||
command/archive/push/push.c \ | ||
command/help/help.c \ | ||
command/command.c \ | ||
common/error.c \ | ||
common/exit.c \ | ||
common/ini.c \ | ||
common/log.c \ | ||
common/memContext.c \ | ||
common/regExp.c \ | ||
common/time.c \ | ||
common/type/buffer.c \ | ||
common/type/keyValue.c \ | ||
common/type/list.c \ | ||
common/type/string.c \ | ||
common/type/stringList.c \ | ||
common/type/variant.c \ | ||
common/type/variantList.c \ | ||
common/wait.c \ | ||
config/config.c \ | ||
config/define.c \ | ||
config/load.c \ | ||
config/parse.c \ | ||
perl/config.c \ | ||
perl/exec.c \ | ||
storage/helper.c \ | ||
storage/storage.c \ | ||
main.c | ||
|
||
# Create obj list from source list | ||
OBJS=$(SRCS:.c=.o) | ||
|
||
#################################################################################################################################### | ||
# Compile and link | ||
#################################################################################################################################### | ||
pgbackrest: $(OBJS) | ||
$(CC) -o pgbackrest $(OBJS) $(LDFLAGS) | ||
|
||
.c.o: | ||
$(CC) $(CFLAGS) -c $< -o $@ | ||
|
||
#################################################################################################################################### | ||
# Installation. DESTDIR can be used to modify the install location. | ||
#################################################################################################################################### | ||
install: pgbackrest | ||
sudo install -d $(DESTDIR)/usr/bin | ||
sudo install -m 755 pgbackrest $(DESTDIR)/usr/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters