sup

small tool for privilege escalation
git clone https://git.parazyd.org/sup
Log | Files | Refs | README | LICENSE

Makefile (882B)


      1 # sup: scale user privileges
      2 # See LICENSE file for copyright and license details.
      3 .POSIX:
      4 
      5 # paths
      6 PREFIX = /usr/local
      7 MANPREFIX = ${PREFIX}/share/man
      8 
      9 # use system flags
     10 SUP_CFLAGS   = ${CFLAGS} -Wall -Werror -pedantic -std=c99
     11 SUP_CPPFLAGS = ${CPPFLAGS}
     12 SUP_LDFLAGS  = ${LDFLAGS} -static -s
     13 
     14 BIN = sup
     15 MAN = $(BIN).1
     16 OBJ = $(BIN:=.o) sha256.o
     17 
     18 all: $(BIN)
     19 
     20 $(OBJ): config.h
     21 
     22 config.h:
     23 	cp config.def.h config.h
     24 
     25 .c.o:
     26 	$(CC) -c $(SUP_CFLAGS) $(SUP_CPPFLAGS) $<
     27 
     28 $(BIN): $(OBJ)
     29 	$(CC) $(OBJ) $(SUP_LDFLAGS) -o $@
     30 
     31 clean:
     32 	rm -f $(BIN) $(OBJ)
     33 
     34 install: all
     35 	mkdir -p $(DESTDIR)$(PREFIX)/bin
     36 	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
     37 	cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
     38 	cp -f $(MAN) $(DESTDIR)$(MANPREFIX)/man1
     39 	chmod 4711 $(DESTDIR)$(PREFIX)/bin/$(BIN)
     40 
     41 uninstall:
     42 	rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
     43 	rm -f $(DESTDIR)$(MANPREFIX)/man1/$(MAN)
     44 
     45 .PHONY: all clean install uninstall