Started using Make instead of CMake

pull/19/head
mananapr 5 years ago
parent a3bc4b299c
commit 5ba2f4d6af

8
.gitignore vendored

@ -1,9 +1 @@
cf
cfiles
build.ninja
CMakeCache.txt
.ninja_deps
.ninja_log
rules.ninja
cmake_install.cmake
CMakeFiles/

@ -1,34 +0,0 @@
cmake_minimum_required (VERSION 3.10)
project(cfiles
VERSION 0.0.1
)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(FLAGS "-ggdb -Wall -Wextra -Wundef -Wwrite-strings -Wpointer-arith -Wmissing-declarations -Wredundant-decls")
set(FLAGS "${FLAGS} -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-nonliteral -Wformat-security")
set(FLAGS "${FLAGS} -Wsign-compare -Wstrict-aliasing -Wshadow -Winline -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self")
set(FLAGS "${FLAGS} -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type ")
set(FLAGS "${FLAGS} -Wno-switch -Wno-error=unused-parameter")
set(FLAGS "${FLAGS} -Wno-error=missing-field-initializers")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}")
#Runs pkg-config --libs --cflags ncurses
include(FindPkgConfig)
pkg_search_module(NCURSES REQUIRED ncurses)
add_executable(cfiles
cf.c
)
target_include_directories(cfiles PRIVATE
${NCURSES_INCLUDE_DIRS}
)
target_compile_definitions(cfiles PRIVATE
${NCURSES_CFLAGS}
)
target_link_libraries(cfiles
${NCURSES_LIBRARIES}
)

@ -0,0 +1,23 @@
CC = gcc
CFLAGS = -I. -Wall
LIBS = -lncurses
SRCS = cf.c
OBJS = $(SRCS: .c = .o)
PROG = cfiles
DEST = /usr/local/bin
all: $(OBJS)
$(CC) $(CFLAGS) $(LIBS) $(OBJS) -o $(PROG)
.c.o:
$(CC) $(CFLAGS) -c $<
clean:
rm *.o
rm *~
install:
cp -v $(PROG) $(DEST)
uninstall:
rm -v "$(DEST)/$(PROG)"

@ -9,9 +9,8 @@ minimal.
- ncurses
- `cp`and `mv` for copying and moving
- `fzf` for searching
- `w3mimgdisplay` for image previews
- `w3mimgdisplay` or `Überzug` for image previews
- `xdg-open` for opening programs
- `vim` for renaming, bulk renaming and editing clipboard
- `mediainfo` for viewing media info and file sizes
- `sed` for removing a particular selection
- `atool` for archive previews
@ -19,9 +18,13 @@ minimal.
## Compiling and Installation
To compile, run
`gcc cf.c -lncurses -o cf`
`make`
To install, simply move the generated executable to a directory that is in your `$PATH`
and then run,
`sudo make install`
to install.
## Keybindings
| Key | Function |

@ -1,7 +0,0 @@
#!/bin/bash -e
if [ ! -e build.ninja ] ; then
cmake -DCMAKE_BUILD_TYPE=Debug -GNinja CMakeLists.txt .
fi
ninja $*

@ -603,10 +603,6 @@ void getImgPreview(char *filepath, int maxy, int maxx)
execl(DISPLAYIMG,DISPLAYIMG,arg1,arg2,arg3,arg4,filepath,(char *)NULL);
exit(1);
}
else
{
signal(SIGCHLD, SIG_IGN);
}
}

Loading…
Cancel
Save