12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- DESTDIR ?=
- PREFIX ?= /usr
- COMPRESS_MAN ?= yes
- STRIP_BINARY ?= yes
- EXAMPLES ?= yes
- CSECFLAGS ?= -fstack-protector-all -Wall --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fstack-check -DPARANOID -std=gnu99
- CFLAGS ?= -pipe -O2
- CFLAGS += $(CSECFLAGS) $(shell pkg-config --cflags glib-2.0)
- DEBUGCFLAGS ?= -pipe -Wall -ggdb3 -export-dynamic -Wno-error=unused-variable -O0 -pipe $(CSECFLAGS)
- CARCHFLAGS ?= -march=native
- LIBS :=
- LDSECFLAGS ?= -Xlinker -zrelro
- LDFLAGS += $(LDSECFLAGS) -pthread $(shell pkg-config --libs glib-2.0)
- INC := $(INC)
- INSTDIR = $(DESTDIR)$(PREFIX)
- objs=\
- main.o\
- binary=kiosk-hangup-sensor
- .PHONY: doc
- all: $(objs)
- $(CC) $(CARCHFLAGS) $(CFLAGS) $(LDFLAGS) $(objs) $(LIBS) -o $(binary)
- %.o: %.c
- $(CC) $(CARCHFLAGS) $(CFLAGS) $(INC) $< -c -o $@
- debug:
- $(CC) $(CARCHFLAGS) -DDEBUG2 $(DEBUGCFLAGS) $(INC) $(LDFLAGS) *.c $(LIBS) -o $(binary)
- clean:
- rm -f $(binary) *.o test
- distclean: clean
- rm -f *.orig
- doc:
- doxygen .doxygen
- install:
- install -d "$(INSTDIR)/bin" "$(INSTDIR)/share/man/man3"
- ifeq ($(STRIP_BINARY),yes)
- strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version $(binary)
- endif
- install -m 755 $(binary) "$(INSTDIR)"/bin/
- deinstall:
- rm -f "$(INSTDIR)"/bin/$(binary)
- format:
- astyle --style=linux --indent=tab --indent-cases --indent-switches --indent-preproc-define --break-blocks --pad-oper --pad-paren --delete-empty-lines *.[ch] | grep -v Unchanged || true
|