aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile33
1 files changed, 17 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index f841829..dae30f0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,31 +1,32 @@
-VERSION = 1.5
+.POSIX:
-PREFIX = /usr
-MANPREFIX = $(PREFIX)/share/man
-
-PKGNAME = gpp
-COMMAND = gpp
-
-PY = python
-SHEBANG = /usr/bin/env $(PY)
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
all: gpp
+gpp.o: gpp.c arg.h
-gpp: gpp.py
- env SHEBANG='$(SHEBANG)' $(PY) gpp.py < gpp.py > $@
+gpp: gpp.o
+ $(CC) -o $@ gpp.o $(LDFLAGS)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
install: gpp
install -dm755 -- "$(DESTDIR)$(PREFIX)/bin"
- install -m755 -- gpp "$(DESTDIR)$(PREFIX)/bin/$(COMMAND)"
+ install -m755 -- gpp "$(DESTDIR)$(PREFIX)/bin/gpp"
install -dm755 -- "$(DESTDIR)$(MANPREFIX)/man"
- install -m644 -- gpp.1 "$(DESTDIR)$(MANPREFIX)/man/$(COMMAND).1"
+ install -m644 -- gpp.1 "$(DESTDIR)$(MANPREFIX)/man/gpp.1"
uninstall:
- -rm -- "$(DESTDIR)$(PREFIX)/bin/$(COMMAND)"
- -rm -- "$(DESTDIR)$(MANPREFIX)/man/$(COMMAND).1"
+ -rm -- "$(DESTDIR)$(PREFIX)/bin/gpp"
+ -rm -- "$(DESTDIR)$(MANPREFIX)/man/gpp.1"
clean:
- -rm -rf -- gpp bin obj
+ -rm -rf -- gpp *.o *.su
+
+.SUFFIXES:
+.SUFFIXES: .o .c
.PHONY: all install uninstall clean