Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# Autotools Output
config.log
config.status

# Autotools Cache
autom4ate.cache/

# Target Executable
dcp

4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

| Date | Description | Author | Username |
| ---- | ----------- | ------ | -------- |
| 04-Jun-2019 | Refactored project and build system | Jose Fernando Lopez Fernandez | [jflopezfernandez](https://github.com/) |
320 changes: 159 additions & 161 deletions INSTALL

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

CP = cp
MV = mv -f
RM = rm -f

vpath %.ggo src
vpath %.c src
vpath %.h include

SRCS = $(notdir $(wildcard src/*.c))
OBJS = $(patsubst %.c, %.o, $(SRCS)) cmdline.o

VERSION = 1.0.6

CC = gcc
CFLAGS = -g -O2
CPPFLAGS =
LDFLAGS = -lz -ldb -ljansson -lcrypto

COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) -I include -DVERSION=$(VERSION)

GENGETOPT = gengetopt
GOPTFLAGS = --unamed-opts -a cmdline_info -F cmdline -i src/option_parser.ggo --set-version=1.06

TARGET = dcp

###########################################################
#
# Building
#
###########################################################

all: $(TARGET)

$(TARGET): cmdline.o $(OBJS)
$(COMPILE) -o $@ $(OBJS) $(LDFLAGS)

%.o: %.c
$(COMPILE) -c -o $@ $^

cmdline.o: cmdline.c
$(COMPILE) -c -o $@ src/$^

cmdline.c: option_parser.ggo
$(GENGETOPT) $(GOPTFLAGS)
$(MV) cmdline.c src/
$(MV) cmdline.h include/

clean:
$(RM) $(OBJS) $(TARGET)

distclean: clean
$(RM) src/cmdline.c include/cmdline.h
$(RM) include/config.h

###########################################################
#
# Installation
#
###########################################################

PREFIX = /usr/local
BINDIR = ${exec_prefix}/bin
DOCDIR = ${datarootdir}/doc/${PACKAGE_TARNAME}
DATAROOT = ${prefix}/share

install:
$(CP) -u $(TARGET) $(PREFIX)$(BINDIR)

uninstall:
$(RM) $(PREFIX)$(BINDIR)/$(TARGET)
4 changes: 0 additions & 4 deletions Makefile.am

This file was deleted.

71 changes: 71 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

CP = cp
MV = mv -f
RM = rm -f

vpath %.ggo src
vpath %.c src
vpath %.h include

SRCS = $(notdir $(wildcard src/*.c))
OBJS = $(patsubst %.c, %.o, $(SRCS)) cmdline.o

VERSION = @PROGRAM_VERSION@

CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@ @LIBZLIB@ @LIBDB@ @LIBJANSSON@ @LIBCRYPTO@ @LIBS@

COMPILE = $(CC) $(CFLAGS) $(CPPFLAGS) -I include -DVERSION=$(VERSION)

GENGETOPT = gengetopt
GOPTFLAGS = --unamed-opts -a cmdline_info -F cmdline -i src/option_parser.ggo --set-version=1.06

TARGET = @PROGRAM_NAME@

###########################################################
#
# Building
#
###########################################################

all: $(TARGET)

$(TARGET): cmdline.o $(OBJS)
$(COMPILE) -o $@ $(OBJS) $(LDFLAGS)

%.o: %.c
$(COMPILE) -c -o $@ $^

cmdline.o: cmdline.c
$(COMPILE) -c -o $@ src/$^

cmdline.c: option_parser.ggo
$(GENGETOPT) $(GOPTFLAGS)
$(MV) cmdline.c src/
$(MV) cmdline.h include/

clean:
$(RM) $(OBJS) $(TARGET)

distclean: clean
$(RM) src/cmdline.c include/cmdline.h
$(RM) include/config.h

###########################################################
#
# Installation
#
###########################################################

PREFIX = @prefix@
BINDIR = @bindir@
DOCDIR = @docdir@
DATAROOT = @datarootdir@

install:
$(CP) -u $(TARGET) $(PREFIX)$(BINDIR)

uninstall:
$(RM) $(PREFIX)$(BINDIR)/$(TARGET)
17 changes: 0 additions & 17 deletions README

This file was deleted.

63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

# DCP - Copy and Profile files and directories

The project has been refactored to use a more canonical build process. To do so, you now just need to configure and run `make`.

```bash
./configure
make
make install
```

> <strong>Note:</strong> You will probably need to run `make install` as root.

You will still need [gengetopt](https://www.gnu.org/software/gengetopt/gengetopt.html), as it's used to generate a command line parser for the application, but now you will be explicitly told so during the configuration process if you do not have it. If the configuration process succeeds, `gengetopt` was successfully found in your path.

Here is a breakdown of the libraries you will need to successfully build this application.

| Library Name | Description | Version Tested |
| ------------ | ----------- | ------- |
| [libcrypto](https://wiki.openssl.org/index.php/Libcrypto_API) | From OpenSSL | - |
| [libdb](https://github.com/berkeleydb/libdb) | Berkley DB | 5.3.28-4 |
| [gengetopt](https://www.gnu.org/software/gengetopt/gengetopt.html) | Command line args parser generator | 2.22.6-7 |

## Configuration

The build system refactoring process is still ongoing, so the configuration script is not as robust as it could be. It does, however, successfully build on [gcc](https://gcc.gnu.org/), [clang](http://llvm.org/), and [Intel's](https://software.intel.com/en-us/c-compilers) `icc` compiler.

Configuration is pretty standard. You can modify the build as usual through the `CFLAGS`, `CPPFLAGS`, and `LDFLAGS` as always, just keep in mind that currently the compiler set by `CC` is used as the linker driver, so whatever settings you set in `LDFLAGS` right now must play well with whatever C compiler you choose to use. Also, any additional libraries you wish to link against should be set via the `LIBS` variable, not `LDFLAGS`.

If you run into any weird errors on a rebuild, the safest bet is to run `make distclean` then run `./configure` again to regenerate the header files for the build.

> You can not yet directly install it using the usual `make install` command, however. This is a work in progress, as the entire project had to be refactored.

You should now be able to successfully install `dcp` after building, by way of the usual `make install` command. It does not yet use `install`, but rather simply moves the newly built binary into the destination directory set during configuration. The default prefix is the usual `/usr/local` and can be configured using `--prefix=/usr`, or whatever you so wish.

You can also uninstall the binary by running `make uninstall` as root, and the binary installed by `make install` will be removed.

### Supported Compilers

This is a breakdown of the compilers on which the current version of the project has been tested. The GCC trunk branch was current as of 9:30 PM Eastern time, June 4th, 2019. All of the builds were tested on an x86-64 Arch Linux system. If you run into any issues in a different environment, be sure to include that in the issue description so we can spin up a VM with the right OS.

#### GCC

| Version | Tested | Status |
| ------- | ------ | ------ |
| 8.3.0 | Yes | OK |
| 9.1.0 | Yes | OK |
| 10.0.0 | Yes | OK |
| trunk[1] | Yes | OK |

[1] gcc (GCC) 10.0.0 20190605 (experimental)

#### Clang

| Version | Tested | Status |
| ------- | ------ | ------ |
| 8.0.0-4 | Yes | OK |

#### Intel ICC

| Version | Tested | Status |
| ------- | ------ | ------ |
| 19.0.4.235 | Yes | OK |
29 changes: 0 additions & 29 deletions bootstrap.sh

This file was deleted.

16 changes: 0 additions & 16 deletions cleanup.sh

This file was deleted.

Loading