Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #32

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# back-up files (vim etc)
*.*~

# Object files
*.o
*.ko
*.obj
*.elf

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex

# Debug files
*.dSYM/

# Cmake temp & generated files
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
Makefile
*config.h

5 changes: 4 additions & 1 deletion src/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.PHONY: all clean install uninstall clean distclean examples pyswig-build pyswig-install pyswig-uninstall py-build py-install py-uninstall
CC=@CC@
SWIG=@SWIG@
PYDEV=@PYDEV@
Expand All @@ -15,14 +16,16 @@ INCDIR=@includedir@
INC=-I$(PYDEV)
TARGET=mpsse

export CFLAGS

all: $(TARGET) py$(BUILD)-build

$(TARGET): mpsse.o fast.o
$(CC) $(CFLAGS) -shared -Wl,$(SONAME),lib$(TARGET).so $(TARGET).o fast.o support.o \
-o lib$(TARGET).so $(LDFLAGS)
ar rcs lib$(TARGET).a $(TARGET).o fast.o support.o

example-code:
examples:
make -C examples

mpsse.o: support.o
Expand Down
11 changes: 11 additions & 0 deletions src/examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Additional gitignore
# Exclude all built executables.

bitbang
ds1305
gpio
i2ceeprom
spiflash
spiflashfast

# No need to have patterns for windows *.exe as these are allready covered
23 changes: 16 additions & 7 deletions src/examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
.PHONY: clean distclean
LDFLAGS=-lmpsse

all: spiflash spiflashfast i2ceeprom ds1305 gpio bitbang
# Define default CFLAGS if not given
# NOTE: You may want to adjust with local changes here
ifeq ($(CFLAGS),)
CFLAGS=-DLIBFTDI1=1 -O0 -g3 -ggdb
endif

spiflash:
TARGETS=spiflash spiflashfast i2ceeprom ds1305 gpio bitbang i2cpca9685

all: $(TARGETS)

spiflash: spiflash.c
$(CC) $(CFLAGS) spiflash.c -o spiflash $(LDFLAGS)

spiflashfast:
spiflashfast: spiflashfast.c
$(CC) $(CFLAGS) spiflashfast.c -o spiflashfast $(LDFLAGS)

i2ceeprom:
i2ceeprom: i2ceeprom.c
$(CC) $(CFLAGS) i2ceeprom.c -o i2ceeprom $(LDFLAGS)

ds1305:
$(CC) $(CFLAGS) ds1305.c -o ds1305 $(LDFLAGS)

gpio:
gpio: gpio.c
$(CC) $(CFLAGS) gpio.c -o gpio $(LDFLAGS)

bitbang:
bitbang: bitbang.c
$(CC) $(CFLAGS) bitbang.c -o bitbang $(LDFLAGS)

clean:
rm -f *.dSYM
rm -f bitbang gpio ds1305 i2ceeprom spiflash spiflashfast
rm -f $(TARGETS)

distclean: clean
1 change: 1 addition & 0 deletions src/examples/bitbang.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <mpsse.h>

int main(void)
Expand Down
1 change: 1 addition & 0 deletions src/examples/gpio.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <mpsse.h>

Expand Down