Open raashidmuhammed opened 2 months ago
cc = gcc
calc: main.o add.o sub.o mul.o div.o
$(cc) main.o add.o sub.o mul.o div.o -o calc
main.o: main.c
$(cc) -c main.c
add.o: add.c
$(cc) -c add.c
sub.o: sub.c
$(cc) -c sub.c
mul.o: mul.c
$(cc) -c mul.c
div.o: div.c
$(cc) -c div.c
clean:
rm *.o calc
The result must show according to their operations know. But it shows the same results for all operations bro. Why does it show like that please check the file bro.
Write a project makefile, should be present in the top directory
all: compile doc
compile:
<compile commands>
upload:
<upload commands>
setup:
<setup commands>
doc: README.pdf mqtt-setup.pdf dashboard.pdf
%.pdf: %.md
<pdf generation command from mardown texts>
The result must show according to their operations know. But it shows the same results for all operations bro. Why does it show like that please check the file bro.
#variables
ARDUINO_CLI := $HOME/bin/arduino-cli
BOARD_REGEX :='[[:alnum:]]\+:[[:alnum:]]\+:[-_[:alnum:]]\+'
BOARD := $($ARDUINO_CLI board list | grep -o $BOARD_REGEX)
# If esp8266 board is not detected automatically, we give a manual board name for esp8266
ifeq ($(BOARD),)
BOARD := esp8266:esp8266:nodemcuv2
endif
PORT := "/dev/ttyUSB0"
compile:
$(ARDUINO_CLI) compile --export-binaries -b $(BOARD) .
upload:
$(ARDUINO_CLI) upload -p $(PORT) --fqbn $(BOARD) .
doc: README.pdf mqtt-setup.pdf dashboard.pdf
README.pdf: README.md
pandoc README.md -o README.pdf
mqtt-setup.pdf: mqtt-setup.md
pandoc mqtt-setup.md -o mqtt-setup.pdf
dashboard.pdf: dashboard.md
pandoc dashboard.md -o dashboard.pdf