mirror of
https://github.com/UzixLS/picocom.git
synced 2025-07-19 07:21:18 +03:00
Merge pull request #58 from Joe-Merten/custom-baud
Small makefile simplification for custom baudrate support
This commit is contained in:
10
Makefile
10
Makefile
@ -36,19 +36,14 @@ CPPFLAGS += -DHISTFILE=\"$(HISTFILE)\" \
|
||||
OBJS += linenoise-1.0/linenoise.o
|
||||
linenoise-1.0/linenoise.o : linenoise-1.0/linenoise.c linenoise-1.0/linenoise.h
|
||||
|
||||
## Comment this in to enable custom baudrate support for OSX (Tiger and above)
|
||||
## Comment this in to enable custom baudrate support for Linux (kernels > 2.6), OSX (Tiger and above)
|
||||
#CPPFLAGS += -DUSE_CUSTOM_BAUD
|
||||
|
||||
## Comment this in to enable custom baudrate support for Linux (kernels > 2.6)
|
||||
#CPPFLAGS += -DUSE_CUSTOM_BAUD
|
||||
#OBJS += termios2.o
|
||||
#termios2.o : termios2.c termios2.h termbits2.h
|
||||
|
||||
## Comment this IN to remove help strings (saves ~ 4-6 Kb).
|
||||
#CPPFLAGS += -DNO_HELP
|
||||
|
||||
|
||||
OBJS += picocom.o term.o fdio.o split.o
|
||||
OBJS += picocom.o term.o fdio.o split.o termios2.o
|
||||
picocom : $(OBJS)
|
||||
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
|
||||
|
||||
@ -56,6 +51,7 @@ picocom.o : picocom.c term.h
|
||||
term.o : term.c term.h
|
||||
split.o : split.c split.h
|
||||
fdio.o : fdio.c fdio.h
|
||||
termios2.o : termios2.c termios2.h termbits2.h
|
||||
|
||||
.c.o :
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
|
||||
|
11
termios2.c
11
termios2.c
@ -23,9 +23,12 @@
|
||||
* USA
|
||||
*/
|
||||
|
||||
#ifndef __linux__
|
||||
#error "Linux specific code!"
|
||||
#endif /* of __linux__ */
|
||||
#if defined(__linux__) && defined(USE_CUSTOM_BAUD)
|
||||
|
||||
#include <linux/version.h>
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,0)
|
||||
#error "This code requires Linux kernel > 2.6!"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@ -180,6 +183,8 @@ cf2setispeed_custom(struct termios *tios, int speed)
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
#endif /* __linux__ && USE_CUSTOM_BAUD */
|
||||
|
||||
/*
|
||||
* Local Variables:
|
||||
* mode:c
|
||||
|
Reference in New Issue
Block a user