feostech / vehicle-alcohol-detection

0 stars 0 forks source link

Add Makefile for project #14

Open raashidmuhammed opened 2 months ago

raashidmuhammed commented 2 months ago

calc: main.o add.o sub.o
        gcc main.o add.o sub.o -o calc

main.o: main.c
        gcc -c main.c

add.o: add.c
        gcc -c add.c

sub.o: sub.c
        gcc -c sub.c
Thowfeek19 commented 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

make

Jothiprasath0014 commented 2 months ago

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.

raashidmuhammed commented 2 months ago

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>
Thowfeek19 commented 2 months ago

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.

m7

Thowfeek19 commented 2 months ago
#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