Skip to content
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
27 changes: 20 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
# Use config.mak to override any of the following variables.
# Do not make changes here.

.POSIX:

prefix = /usr/local
bindir = $(prefix)/bin
mandir = $(prefix)/share/man

SRCS := $(sort $(wildcard *.c))
OBJS := $(SRCS:.c=.o)
OBJS = display.o \
file.o \
hexedit.o \
interact.o \
mark.o \
misc.o \
page.o \
search.o

CFLAGS += -Wall -D_GNU_SOURCE -pipe
CFLAGS = -Wall -D_GNU_SOURCE -pipe

-include config.mak
include config.mak

all: hexedit

$(OBJS): hexedit.h

install: hexedit hexedit.1
install -D -m 755 hexedit $(DESTDIR)$(bindir)/hexedit
install -D -m 644 hexedit.1 $(DESTDIR)$(mandir)/man1/hexedit.1
Expand All @@ -23,9 +33,12 @@ clean:
rm -f $(OBJS)

hexedit: $(OBJS)
$(CC) $(LDFLAGS) $(OBJS) -o hexedit -lncurses
$(CC) $(LDFLAGS) -o hexedit $(OBJS) -lncurses

.SUFFIXES:
.SUFFIXES: .o .c

%.o: %.c hexedit.h
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
.c.o:
$(CC) $(CPPFLAGS) $(CFLAGS) -c $<

.PHONY: all clean install
Empty file added config.mak
Empty file.