hysteria

ii wrapper script
git clone git://git.2f30.org/hysteria
Log | Files | Refs | README | LICENSE

Makefile (1658B)


      1 include config.mk
      2 
      3 SRC = hysteria-highlight.c hysteria-namelist.c
      4 BIN = $(SRC:.c=)
      5 HDR = arg.h config.def.h util.h
      6 LIB = util/strlcpy.o
      7 OBJ = ${SRC:.c=.o} ${LIB}
      8 
      9 all: options binlib hysteria-highlight hysteria-namelist
     10 
     11 binlib: util.a
     12 	$(MAKE) bin
     13 
     14 bin: $(BIN)
     15 
     16 ${OBJ}: config.mk util.h config.h
     17 
     18 options:
     19 	@echo hysteria build options:
     20 	@echo "CFLAGS   = ${CFLAGS}"
     21 	@echo "LDFLAGS  = ${LDFLAGS}"
     22 	@echo "CC       = ${CC}"
     23 
     24 .o:
     25 	@echo LD $@
     26 	@$(LD) -o $@ $< util.a $(LDFLAGS)
     27 
     28 .c.o:
     29 	@echo CC $<
     30 	@$(CC) -c -o $@ $< $(CFLAGS)
     31 
     32 config.h:
     33 	@echo creating $@ from config.def.h
     34 	@cp config.def.h $@
     35 
     36 util.a: $(LIB)
     37 	@echo AR $@
     38 	@$(AR) -r -c $@ $?
     39 	@ranlib $@
     40 
     41 install: all
     42 	mkdir -p ${DESTDIR}${PREFIX}/bin
     43 	cp -f \
     44 		hysteria \
     45 		hysteria-autojoin \
     46 		hysteria-connect \
     47 		hysteria-highlight \
     48 		hysteria-monitor \
     49 		hysteria-namelist \
     50 		hysteria-waitfile \
     51 		${DESTDIR}${PREFIX}/bin
     52 	chmod 755 \
     53 		${DESTDIR}${PREFIX}/bin/hysteria \
     54 		${DESTDIR}${PREFIX}/bin/hysteria-autojoin \
     55 		${DESTDIR}${PREFIX}/bin/hysteria-connect \
     56 		${DESTDIR}${PREFIX}/bin/hysteria-highlight \
     57 		${DESTDIR}${PREFIX}/bin/hysteria-monitor \
     58 		${DESTDIR}${PREFIX}/bin/hysteria-namelist \
     59 		${DESTDIR}${PREFIX}/bin/hysteria-waitfile
     60 
     61 uninstall:
     62 	rm -f \
     63 		${DESTDIR}${PREFIX}/bin/hysteria \
     64 		${DESTDIR}${PREFIX}/bin/hysteria-autojoin \
     65 		${DESTDIR}${PREFIX}/bin/hysteria-connect \
     66 		${DESTDIR}${PREFIX}/bin/hysteria-highlight \
     67 		${DESTDIR}${PREFIX}/bin/hysteria-monitor \
     68 		${DESTDIR}${PREFIX}/bin/hysteria-namelist \
     69 		${DESTDIR}${PREFIX}/bin/hysteria-waitfile
     70 
     71 clean:
     72 	@echo cleaning
     73 	@rm -f ${BIN} ${LIB} util.a ${OBJ}
     74 
     75 .PHONY: all hysteria options clean dist install uninstall