Update Makefile
This commit is contained in:
parent
702bb46689
commit
42c8250815
2 changed files with 13 additions and 12 deletions
24
Makefile
24
Makefile
|
@ -1,5 +1,4 @@
|
||||||
.POSIX:
|
.POSIX:
|
||||||
.SUFFIXES:
|
|
||||||
|
|
||||||
VERSION = 1.0
|
VERSION = 1.0
|
||||||
TARGET = apm
|
TARGET = apm
|
||||||
|
@ -7,20 +6,23 @@ MANPAGE = $(TARGET).1
|
||||||
PREFIX ?= /usr/local
|
PREFIX ?= /usr/local
|
||||||
BINDIR = $(PREFIX)/bin
|
BINDIR = $(PREFIX)/bin
|
||||||
MANDIR = $(PREFIX)/share/man/man1
|
MANDIR = $(PREFIX)/share/man/man1
|
||||||
|
PKG_CONFIG = pkg-config
|
||||||
|
|
||||||
LDFLAGS != pkg-config --libs libsodium
|
PKGS = libsodium
|
||||||
CFLAGS = -Os -march=native -mtune=native -pipe -s -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE
|
LIBS != $(PKG_CONFIG) --libs $(PKGS)
|
||||||
|
INCS != $(PKG_CONFIG) --cflags $(PKGS)
|
||||||
|
CFLAGS += -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE $(INCS)
|
||||||
|
|
||||||
SRC = apm.c
|
.c.o:
|
||||||
|
$(CC) -o $@ $(CFLAGS) -c $<
|
||||||
|
|
||||||
$(TARGET): $(SRC)
|
$(TARGET): $(TARGET).o
|
||||||
$(CC) $(SRC) -o $@ $(CFLAGS) $(LDFLAGS)
|
$(CC) -o $@ $(TARGET).o $(LIBS)
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
mkdir -p $(TARGET)-$(VERSION)
|
mkdir -p $(TARGET)-$(VERSION)
|
||||||
cp -R README.md $(MANPAGE) $(TARGET) $(TARGET)-$(VERSION)
|
cp -R README.md $(MANPAGE) $(TARGET) $(TARGET)-$(VERSION)
|
||||||
tar -cf $(TARGET)-$(VERSION).tar $(TARGET)-$(VERSION)
|
tar -czf $(TARGET)-$(VERSION).tar.gz $(TARGET)-$(VERSION)
|
||||||
gzip $(TARGET)-$(VERSION).tar
|
|
||||||
rm -rf $(TARGET)-$(VERSION)
|
rm -rf $(TARGET)-$(VERSION)
|
||||||
|
|
||||||
install: $(TARGET)
|
install: $(TARGET)
|
||||||
|
@ -32,11 +34,11 @@ install: $(TARGET)
|
||||||
chmod 644 $(DESTDIR)$(MANDIR)/$(MANPAGE)
|
chmod 644 $(DESTDIR)$(MANDIR)/$(MANPAGE)
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm $(DESTDIR)$(BINDIR)/$(TARGET)
|
rm -f $(DESTDIR)$(BINDIR)/$(TARGET)
|
||||||
rm $(DESTDIR)$(MANDIR)/$(MANPAGE)
|
rm -f $(DESTDIR)$(MANDIR)/$(MANPAGE)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm $(TARGET)
|
rm -f $(TARGET) *.o
|
||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
|
|
1
apm.c
1
apm.c
|
@ -413,5 +413,4 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue