mirror of
https://github.com/troglobit/libuev.git
synced 2026-11-07 16:00:55 +00:00
Move test.c and joystick.c to examples/
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
d1b9fd17f3
commit
5ecc6d64b4
6 files changed
+86
-21
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
# -*-Makefile-*- for libuEv
|
# libuEv main build file
|
||||||
#
|
#
|
||||||
# Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
|
# Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
|
||||||
# Copyright (c) 2013-2015 Joachim Nilsson <troglobit()gmail!com>
|
# Copyright (c) 2013-2015 Joachim Nilsson <troglobit()gmail!com>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#
|
#
|
||||||
.PHONY: all test clean
|
.PHONY: all test clean joystick test examples
|
||||||
|
|
||||||
#VERSION = $(shell git tag -l | tail -1)
|
#VERSION = $(shell git tag -l | tail -1)
|
||||||
VERSION ?= 1.0.5-dev
|
VERSION ?= 1.0.5-dev
|
||||||
@@ -36,7 +36,9 @@ STRIP ?= $(CROSS)strip
|
|||||||
CFLAGS += -fPIC -Os
|
CFLAGS += -fPIC -Os
|
||||||
CPPFLAGS += -W -Wall -Werror
|
CPPFLAGS += -W -Wall -Werror
|
||||||
ARFLAGS = crus
|
ARFLAGS = crus
|
||||||
JUNK = *~ *.bak *.map .*.d DEADJOE *.gdb *.elf core core.*
|
JUNK = *~ *.bak *.map .*.d DEADJOE *.gdb *.elf core core.* *.html
|
||||||
|
|
||||||
|
MAKEFLAGS = --no-print-directory
|
||||||
|
|
||||||
ROOTDIR ?= $(shell pwd)
|
ROOTDIR ?= $(shell pwd)
|
||||||
LIBNAME = $(NAME)
|
LIBNAME = $(NAME)
|
||||||
@@ -56,11 +58,11 @@ SYMLIB = $(LIBNAME).so
|
|||||||
STATICLIB = $(LIBNAME).a
|
STATICLIB = $(LIBNAME).a
|
||||||
TARGET = $(STATICLIB) $(SOLIB)
|
TARGET = $(STATICLIB) $(SOLIB)
|
||||||
|
|
||||||
# Pretty printing and GCC -M for auto dep files
|
export STATICLIB JUNK ROOTDIR CFLAGS CPPFLAGS
|
||||||
%.o: %.c
|
|
||||||
@printf " CC $(subst $(ROOTDIR)/,,$(shell pwd)/)$@\n"
|
|
||||||
@$(CC) $(CFLAGS) $(CPPFLAGS) -c -MMD -MP -o $@ $<
|
|
||||||
|
|
||||||
|
# This magic trick looks like a comment, but works on BSD PMake
|
||||||
|
#include <rules.mk>
|
||||||
|
include rules.mk
|
||||||
|
|
||||||
# Build rules
|
# Build rules
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
@@ -95,26 +97,26 @@ strip: $(TARGET)
|
|||||||
@$(STRIP) --strip-unneeded $(TARGET)
|
@$(STRIP) --strip-unneeded $(TARGET)
|
||||||
@size $(TARGET)
|
@size $(TARGET)
|
||||||
|
|
||||||
test: Makefile test.o $(STATICLIB)
|
|
||||||
@printf " TEST %s\n" $(STATICLIB)
|
|
||||||
@$(CC) $(CPPFLAGS) -g -o test test.c $(STATICLIB) && ./test
|
|
||||||
|
|
||||||
bench: Makefile bench.o $(STATICLIB)
|
bench: Makefile bench.o $(STATICLIB)
|
||||||
@printf " BENCH %s\n" $(STATICLIB)
|
@printf " BENCH %s\n" $(STATICLIB)
|
||||||
@$(CC) $(CPPFLAGS) -g -o bench bench.c $(STATICLIB) && ./bench
|
@$(CC) $(CPPFLAGS) -g -o bench bench.c $(STATICLIB) && ./bench
|
||||||
|
|
||||||
joystick: Makefile joystick.o $(STATICLIB)
|
examples:
|
||||||
@printf " JOTST %s\n" $(STATICLIB)
|
@$(MAKE) -C examples
|
||||||
@$(CC) $(CPPFLAGS) -g -o joystick joystick.c $(STATICLIB) && ./joystick
|
|
||||||
|
test joystick:
|
||||||
|
@$(MAKE) -C examples $@
|
||||||
|
|
||||||
# Runs Clang scan-build on the whole tree
|
# Runs Clang scan-build on the whole tree
|
||||||
check: clean
|
check: clean
|
||||||
@scan-build $(MAKE) all
|
@scan-build $(MAKE) all
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
-@$(MAKE) -C examples $@
|
||||||
-@$(RM) $(TARGET) *.o test joystick bench
|
-@$(RM) $(TARGET) *.o test joystick bench
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
-@$(MAKE) -C examples $@
|
||||||
-@$(RM) $(DEPS) $(JUNK)
|
-@$(RM) $(DEPS) $(JUNK)
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
libuEv | Simple event loop for Linux
|
libuEv | Simple event loop for Linux
|
||||||
====================================
|
====================================
|
||||||
[](https://travis-ci.org/troglobit/libuev)
|
[![Travis Status]][Travis] [![Coverity Status]][Coverity Scan]
|
||||||
[](https://scan.coverity.com/projects/3846)
|
|
||||||
|
|
||||||
|
|
||||||
Table of Contents
|
Table of Contents
|
||||||
@@ -249,12 +248,15 @@ used for inspiration is the very small [Picoev][9] by [Oku Kazuho].
|
|||||||
[7]: http://libev.schmorp.de/bench.html
|
[7]: http://libev.schmorp.de/bench.html
|
||||||
[8]: http://code.google.com/p/libuevent/
|
[8]: http://code.google.com/p/libuevent/
|
||||||
[9]: https://github.com/kazuho/picoev
|
[9]: https://github.com/kazuho/picoev
|
||||||
[LibuEV]: https://github.com/troglobit/libuev
|
[Travis]: https://travis-ci.org/troglobit/libuev
|
||||||
[Oku Kazuho]: https://github.com/kazuho
|
[Travis Status]: https://travis-ci.org/troglobit/libuev.png?branch=master
|
||||||
[Mark Lehmann]: http://software.schmorp.de
|
[Coverity Scan]: https://scan.coverity.com/projects/3846
|
||||||
|
[Coverity Status]: https://scan.coverity.com/projects/3846/badge.svg
|
||||||
|
[LibuEV]: https://github.com/troglobit/libuev
|
||||||
|
[Oku Kazuho]: https://github.com/kazuho
|
||||||
|
[Mark Lehmann]: http://software.schmorp.de
|
||||||
[Joachim Nilsson]: http://troglobit.com
|
[Joachim Nilsson]: http://troglobit.com
|
||||||
[Flemming Madsen]: http://www.madsensoft.dk
|
[Flemming Madsen]: http://www.madsensoft.dk
|
||||||
[Dave Zarzycki, Apple]: http://www.youtube.com/watch?v=cD_s6Fjdri8
|
[Dave Zarzycki, Apple]: http://www.youtube.com/watch?v=cD_s6Fjdri8
|
||||||
|
|
||||||
[libuEv] is developed and maintained by [Joachim Nilsson]
|
[libuEv] is developed and maintained by [Joachim Nilsson]
|
||||||
|
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
# libuEv examples
|
||||||
|
#
|
||||||
|
# Copyright (c) 2012 Flemming Madsen <flemming!madsen()madsensoft!dk>
|
||||||
|
# Copyright (c) 2013-2015 Joachim Nilsson <troglobit()gmail!com>
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
# a copy of this software and associated documentation files (the
|
||||||
|
# "Software"), to deal in the Software without restriction, including
|
||||||
|
# without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
# permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
# the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be
|
||||||
|
# included in all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
#
|
||||||
|
.PHONY: all clean
|
||||||
|
|
||||||
|
TARGET = joystick test
|
||||||
|
OBJS := $(addsuffix .o, $(TARGET))
|
||||||
|
SRCS := $(OBJS:.o=.c)
|
||||||
|
DEPS := $(SRCS:.c=.d)
|
||||||
|
CPPFLAGS += -I../
|
||||||
|
LDFLAGS := -L../
|
||||||
|
LDLIBS := ../$(STATICLIB)
|
||||||
|
|
||||||
|
# This magic trick looks like a comment, but works on BSD PMake
|
||||||
|
#include <../rules.mk>
|
||||||
|
include ../rules.mk
|
||||||
|
|
||||||
|
all: $(TARGET)
|
||||||
|
|
||||||
|
test: test.o
|
||||||
|
|
||||||
|
joystick: joystick.o
|
||||||
|
|
||||||
|
clean:
|
||||||
|
-@$(RM) $(TARGET) *.o
|
||||||
|
|
||||||
|
distclean: clean
|
||||||
|
-@$(RM) $(DEPS) $(JUNK)
|
||||||
|
|
||||||
|
# Include automatically generated rules
|
||||||
|
-include $(DEPS)
|
||||||
File renamed without changes.
@@ -111,7 +111,7 @@ int main(void)
|
|||||||
if (pipe(fd) < 0)
|
if (pipe(fd) < 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* */
|
/* Initialize libuEv */
|
||||||
uev_init(&ctx);
|
uev_init(&ctx);
|
||||||
|
|
||||||
/* Signal watchers, Ctrl-C => SIGINT, Ctrl-\ => SIGQUIT */
|
/* Signal watchers, Ctrl-C => SIGINT, Ctrl-\ => SIGQUIT */
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# Pretty printing and GCC -M for auto dep files
|
||||||
|
%.o: %.c
|
||||||
|
@printf " CC $(subst $(ROOTDIR)/,,$(shell pwd)/)$@\n"
|
||||||
|
@$(CC) $(CFLAGS) $(CPPFLAGS) -c -MMD -MP -o $@ $<
|
||||||
|
|
||||||
|
%: %.o
|
||||||
|
@printf " LINK $(subst $(ROOTDIR)/,,$(shell pwd)/)$@\n"
|
||||||
|
@$(CC) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$@.map -o $@ $^ $(LDLIBS$(LDLIBS-$(@)))
|
||||||
|
|
||||||
Reference in new issue
Block a user