Browse Source

patching system

master
Ivan Polyakov 3 years ago
parent
commit
a4fc276339
  1. 21
      Makefile
  2. 5
      config.mk

21
Makefile

@ -15,8 +15,8 @@ options: @@ -15,8 +15,8 @@ options:
@echo "LDFLAGS = $(STLDFLAGS)"
@echo "CC = $(CC)"
config.h:
cp config.def.h config.h
config.h: patch
cp config.def.h $@
.c.o:
$(CC) $(STCFLAGS) -c $<
@ -29,8 +29,8 @@ $(OBJ): config.h config.mk @@ -29,8 +29,8 @@ $(OBJ): config.h config.mk
st: $(OBJ)
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
clean:
rm -f st $(OBJ) st-$(VERSION).tar.gz config.h
clean: restore
rm -f st $(OBJ) st-$(VERSION).tar.gz config.h *.rej *.orig
dist: clean
mkdir -p st-$(VERSION)
@ -54,4 +54,15 @@ uninstall: @@ -54,4 +54,15 @@ uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/st
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
.PHONY: all options clean dist install uninstall
backup:
find . -iname '*.[ch]' -exec sh -c 'cp $$0 $$0.backup' {} \;
restore:
find . -iname '*.backup' \
-exec sh -c 'mv $$0 "$${0%.backup}"' {} \;
patch: backup
find ${PATCHESDIR} -iname '*.diff' -exec sh -c 'patch < $$0' {} \;
.PHONY: all options clean dist install uninstall backup patch restore

5
config.mk

@ -4,8 +4,9 @@ VERSION = 0.8.5 @@ -4,8 +4,9 @@ VERSION = 0.8.5
# Customize below to fit your system
# paths
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
PATCHESDIR = patches
X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib

Loading…
Cancel
Save