Skip to content

Commit

Permalink
Project reconfigured to use autotools/automake
Browse files Browse the repository at this point in the history
  • Loading branch information
0xvpr committed May 10, 2023
1 parent 61edcd5 commit cfdb103
Show file tree
Hide file tree
Showing 12 changed files with 141 additions and 85 deletions.
82 changes: 72 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
# # Created by https://www.toptal.com/developers/gitignore/api/autotools
# Edit at https://www.toptal.com/developers/gitignore?templates=autotools

### Autotools ###
# http://www.gnu.org/software/automake

Makefile.in
/ar-lib
/mdate-sh
/py-compile
/test-driver
/ylwrap
.deps/
.dirstamp

# http://www.gnu.org/software/autoconf

autom4te.cache
/autoscan.log
/autoscan-*.log
/aclocal.m4
/compile
/config.*
/config.cache
/config.guess
/config.h.in
/config.log
/config.status
/config.sub
/configure
/configure*
/configure.scan
/depcomp
/install-sh
/missing
/stamp-h1

# https://www.gnu.org/software/libtool/

/ltmain.sh

# http://www.gnu.org/software/texinfo

/texinfo.tex

# http://www.gnu.org/software/m4/

m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4

# Generated Makefile
# (meta build system like autotools,
# can automatically generate from config.status script
# (which is called by configure script))
Makefile

### Autotools Patch ###
# End of https://www.toptal.com/developers/gitignore/api/autotools

# Prerequisites
*.d

Expand Down Expand Up @@ -35,15 +97,15 @@
# Exclude Folders
venv
bin
build
Build

# Exclude Compiled Files
*.a
*.o
*.so
*.bin
*.obj
*.exe
*.lib
*.dll
vpr-extract
**/*.a
**/*.o
**/*.so
**/*.bin
**/*.obj
**/*.exe
**/*.lib
**/*.dll
**/vpr-extract
16 changes: 16 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This is the AUTHORS file for the vpr-extract project located at:
https://github.com/0xvpr/vpr-extract

Names should be inserted as follows:

A: Alias Here
C: Contact Information
D: Description Here
C: Copyright Information

-------------------------

A: VPR
C: https://www.github.com/0xvpr (message me here)
D: Original Author
C: MIT
1 change: 1 addition & 0 deletions COPYING
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2023-MAY-10 -> VPR
* Project reconfigured to build and install using GNU automake.
1 change: 1 addition & 0 deletions INSTALL
8 changes: 8 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bin_PROGRAMS = vpr-extract
dist_doc_DATA = README.md
AUTOMAKE_OPTIONS = subdir-objects

vpr_extract_SOURCES = Sources/Main.cpp
vpr_extract_CFLAGS = -std=c++17 -O2 -Wall -Wextra -Werror -Wshadow -Wpedantic -Wconversion \
-ffast-math -funroll-loops
vpr_extract_LDFLAGS = -s
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* 2023-MAY-10
Project reconfigured to build and install using GNU automake.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
This project aims to provide a tool for the extraction of the
.text section of a COFF object file.

## Build Instructions
## Build Instructions (Using GNU Autotools)
```bash
git clone https://github.com/0xvpr/vpr-extract
cd vpr-extract
git clone https://github.com/0xvpr/vpr-extract && cd vpr-extract
autoreconf -i
mkdir Build && cd Build
../configure --prefix=/usr/local
make
# sudo make install # uncomment if you want it available globally (only recommended for LINUX/WSL/MSYS environments)
# make install # uncomment if you want it available globally
```

## Example Usage
Expand All @@ -26,5 +28,5 @@ vpr-extract path/to/file-1 path/to/file-2

## Testing
```bash
make tests
make check
```
5 changes: 5 additions & 0 deletions Sources/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,13 @@ int main(int argc, char** argv) {
file.read((char *)&file_header, sizeof(file_header));

switch (file_header.Machine) {
[[unlikely]]
case machine_type::x86:
break;
[[unlikely]]
case machine_type::iit:
break;
[[likely]]
case machine_type::x64:
break;
default:
Expand Down
7 changes: 0 additions & 7 deletions compile_flags.txt

This file was deleted.

27 changes: 27 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ([2.5])
AC_INIT([vpr-extract], [1.0], [[email protected]])
AC_CONFIG_SRCDIR([Sources/Main.cpp])
AC_CONFIG_HEADERS([config.h])

dnl Checks for programs.
AC_PROG_CXX
AC_PROG_CC

dnl Enable automake
AM_INIT_AUTOMAKE([-Wall -Werror foreign])

dnl Checks for libraries.

dnl Checks for header files.

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T

dnl Checks for library functions.

AC_CONFIG_FILES([Makefile])
AC_OUTPUT
63 changes: 0 additions & 63 deletions makefile

This file was deleted.

0 comments on commit cfdb103

Please sign in to comment.