gcc example, improved readme

master
Ondřej Hruška 9 years ago
parent 8736ee5974
commit 55dc8e75aa
  1. 1
      Makefile
  2. 6
      README.md
  3. 30
      example/Makefile
  4. 0
      example/example.c

@ -49,5 +49,6 @@ clean:
$(Q)$(RM) $(JUNK)
$(Q)cd source && $(RM) $(JUNK)
$(Q)cd lib && $(RM) $(JUNK)
$(Q)cd example && $(RM) $(JUNK)
.PHONY: clean all lib

@ -20,7 +20,11 @@ Built-in commands can be overriden in user command array.
## How to use
See main.c for example of how to use the library.
To test it with regular gcc, run the Makefile in the `example` directory.
The main Makefile builds a library for ARM Cortex M4 (can be easily adjusted for others).
### Stubs to implement
Here's an overview of stubs you have to implement (at the time of writing this readme):

@ -0,0 +1,30 @@
SRC = example.c
SRC += ../source/scpi_parser.c
SRC += ../source/scpi_regs.c
SRC += ../source/scpi_builtins.c
SRC += ../source/scpi_errors.c
INCL_DIR = ../include
CFLAGS = -std=gnu99
CFLAGS += -Wall -Wextra -Wshadow
CFLAGS += -Wwrite-strings -Wold-style-definition -Winline
CFLAGS += -Wredundant-decls -Wfloat-equal -Wsign-compare -Wunused-function
CC = gcc
%.o: %.c
all: example.elf
example.elf: $(SRC)
$(Q)$(CC) $(CFLAGS) -I$(INCL_DIR) -o example.elf $(SRC)
run: example.elf
./example.elf
clean:
rm -f *.o *.d *.so *.elf *.bin *.hex
cd ../source
rm -f *.o *.d *.so *.elf *.bin *.hex
Loading…
Cancel
Save