win32 Makefile for i2ccl.exe
This commit is contained in:
parent
9ad4dcda3a
commit
2831dba645
|
@ -3,7 +3,9 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#if !defined(WIN32)
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#endif
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#define __STDC_FORMAT_MACROS
|
#define __STDC_FORMAT_MACROS
|
||||||
|
|
5
c/go
5
c/go
|
@ -2,9 +2,10 @@ set -e
|
||||||
|
|
||||||
rm -rf build/*
|
rm -rf build/*
|
||||||
make -f linux/Makefile
|
make -f linux/Makefile
|
||||||
build/i2ccl /dev/ttyUSB0 i
|
# build/i2ccl /dev/ttyUSB0 i d
|
||||||
|
# build/i2ccl /dev/ttyUSB0 w 0x48 3 r 0x48 2
|
||||||
|
|
||||||
# make -f win32/Makefile
|
make -f win32/Makefile
|
||||||
# cp build/spicl.exe /data/win10/
|
# cp build/spicl.exe /data/win10/
|
||||||
#
|
#
|
||||||
# rm -f win32gui/obj/* win32gui/bin/Win32App.exe
|
# rm -f win32gui/obj/* win32gui/bin/Win32App.exe
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
CC = /usr/bin/i686-w64-mingw32-g++
|
||||||
|
CFLAGS += -I common -static-libgcc -static-libstdc++
|
||||||
|
|
||||||
|
all: build/i2ccl.exe
|
||||||
|
|
||||||
|
build/i2ccl.exe: win32/i2c.c common/i2cdriver.c
|
||||||
|
mkdir -p build/
|
||||||
|
$(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $^
|
|
@ -0,0 +1,18 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "i2cdriver.h"
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
I2CDriver sd;
|
||||||
|
if (argc < 2) {
|
||||||
|
printf("Usage: i2ccl <PORTNAME> <commands>\n");
|
||||||
|
exit(1);
|
||||||
|
} else {
|
||||||
|
i2c_connect(&sd, argv[1]);
|
||||||
|
if (!sd.connected)
|
||||||
|
exit(1);
|
||||||
|
return i2c_commands(&sd, argc - 2, argv + 2);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue