Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add Makefile

  • Loading branch information...
commit 51ddc04ca61c9255f0786939ecaf0a806886e7de 1 parent eef63b3
Pau Oliva authored
Showing with 36 additions and 0 deletions.
  1. +36 −0 Makefile
36 Makefile
View
@@ -0,0 +1,36 @@
+DESTDIR?=/
+SHELL = /bin/sh
+CC?=gcc
+CFLAGS=-Wall -Wextra -Wwrite-strings -O -g
+INSTALL = /usr/bin/install -c
+INSTALLDATA = /usr/bin/install -c -m 644
+PROGNAME = nbimg
+
+srcdir = .
+prefix = $(DESTDIR)
+bindir = $(prefix)/usr/bin
+docdir = $(prefix)/usr/share/doc
+mandir = $(prefix)/usr/share/man
+
+all: nbimg win32
+
+nbimg: nbimg.c
+ $(CC) $< $(CFLAGS) -o $@
+
+win32:
+ i586-mingw32msvc-gcc $(CFLAGS) $(PROGNAME).c -o $(PROGNAME).exe
+
+install: all
+ mkdir -p $(bindir)
+ $(INSTALL) $(PROGNAME) $(bindir)/$(PROGNAME)
+ mkdir -p $(docdir)/$(PROGNAME)/
+ $(INSTALLDATA) $(srcdir)/README.md $(docdir)/$(PROGNAME)/
+ $(INSTALLDATA) $(srcdir)/LICENSE $(docdir)/$(PROGNAME)/
+
+uninstall:
+ rm -rf $(bindir)/$(PROGNAME)
+ rm -rf $(docdir)/$(PROGNAME)/
+
+
+clean:
+ rm -f *.o $(PROGNAME) $(PROGNAME).exe
Please sign in to comment.
Something went wrong with that request. Please try again.