Skip to content

Instantly share code, notes, and snippets.

@sortie
Created October 30, 2016 12:39
Show Gist options
  • Select an option

  • Save sortie/72a17f7500ae669e3bee1136cfbda46c to your computer and use it in GitHub Desktop.

Select an option

Save sortie/72a17f7500ae669e3bee1136cfbda46c to your computer and use it in GitHub Desktop.
ed Makefile
include ../../build-aux/platform.mak
include ../../build-aux/compiler.mak
include ../../build-aux/version.mak
include ../../build-aux/dirs.mak
OPTLEVEL?=$(DEFAULT_OPTLEVEL)
CFLAGS?=$(OPTLEVEL)
CFLAGS:=$(CXXFLAGS) -Wall -Wextra -Wno-logical-not-parentheses -Wno-unused-parameter
CPPFLAGS:=$(CPPFLAGS) -DBACKWARDS
PROGRAM=ed
MANPAGE=ed.1
OBJS=buf.o glbl.o io.o main.o re.o sub.o undo.o
.PHONY: all
all: $(PROGRAM)
$(PROGRAM): $(OBJS)
$(CC) $(CFLAGS) -o $(PROGRAM) $(OBJS)
%: %.c
$(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBS)
.PHONY: clean
clean:
rm -f $(BINARY) $(OBJS)
.PHONY: install
install: all
mkdir -p $(DESTDIR)$(BINDIR)
install $(PROGRAM) $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(MANDIR)/man1
install $(MANPAGE) $(DESTDIR)$(MANDIR)/man1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment