1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Small makefile simplification reg. custom baud rate support

This commit is contained in:
Joe Merten
2016-12-15 15:47:08 +01:00
parent 52ab89f616
commit 67eaf5400d
2 changed files with 11 additions and 10 deletions

View File

@ -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 $<

View File

@ -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