From e8acd13cc87ea038ecd6103e4088ce3cf5d501d7 Mon Sep 17 00:00:00 2001 From: Donghoon Shin Date: Mon, 19 Sep 2016 17:36:01 +0900 Subject: Update initial source codes Change-Id: I59bac2188ffbfe5a2ad2d9dcb33847aabfaffe44 --- Makefile | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9f06861 --- /dev/null +++ b/Makefile @@ -0,0 +1,51 @@ +# $Revision: 100 $ +VERSION=4.3 + +DEBUG=-g -W -pedantic #-pg #-fprofile-arcs +LDFLAGS+=`pkg-config --libs hidapi-hidraw` +CXXFLAGS+=-O3 -Wall -DVERSION=\"$(VERSION)\" $(DEBUG) `pkg-config --cflags hidapi-hidraw` +CFLAGS+=$(CXXFLAGS) + +OBJS=main.o USBaccessBasic.o USBaccess.o error.o + +all: clewarecontrol + +clewarecontrol: $(OBJS) + $(CXX) $(OBJS) $(LDFLAGS) -o clewarecontrol + +cleware_python: + swig -c++ -python cleware.i + python setup.py build_ext --inplace + ./install-lib.py + +cleware_perl: + swig -c++ -perl5 cleware.i + g++ -c `perl -MConfig -e 'print join(" ", @Config{qw(ccflags optimize cccdlflags)}, "-I$$Config{archlib}/CORE")'` cleware_wrap.cxx USBaccessBasic.cpp USBaccess.cpp + g++ `perl -MConfig -e 'print $$Config{lddlflags}'` cleware_wrap.o USBaccessBasic.o USBaccess.o -o cleware.so + ./install-lib.pl + +install: clewarecontrol + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp clewarecontrol $(DESTDIR)$(PREFIX)/bin + mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1 + cp clewarecontrol.1 $(DESTDIR)$(PREFIX)/share/man/man1/clewarecontrol.1 + gzip -9 $(DESTDIR)$(PREFIX)/share/man/man1/clewarecontrol.1 + +uninstall: clean + rm -f $(DESTDIR)$(PREFIX)/bin/clewarecontrol + rm -f $(DESTDIR)$(PREFIX)/share/man/man1/clewarecontrol.1 + +clean: + rm -rf $(OBJS) clewarecontrol core gmon.out *.da build cleware_wrap.cxx _cleware.so cleware.py* cleware.pm *.o cleware.so + +package: clean + # source package + rm -rf clewarecontrol-$(VERSION)* + mkdir clewarecontrol-$(VERSION) + cp -a *.c* *.h *.i *.pl *py readme*.txt clewarecontrol.1 Makefile LICENSE clewarecontrol-$(VERSION) + tar cf - examples --exclude=.svn | tar xvf - -C clewarecontrol-$(VERSION) + tar czf clewarecontrol-$(VERSION).tgz clewarecontrol-$(VERSION) + rm -rf clewarecontrol-$(VERSION) + +stest: + cppcheck -v --enable=all --inconclusive -I. . 2> err.txt -- cgit v1.2.3