Skip to content

Commit

Permalink
Merge pull request #1 from justin-marian/justin-marian-init-workflow
Browse files Browse the repository at this point in the history
Create casamonitor.yml
  • Loading branch information
justin-marian committed May 22, 2024
2 parents ce445ec + 68ef397 commit 7af8bb6
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get install -y autoconf automake libtool

- name: Check for configure.ac
run: |
if [ ! -f configure.ac ]; then
echo "Error: configure.ac not found!"
exit 1
fi
- name: Generate aclocal.m4
run: aclocal

- name: Add missing auxiliary files
run: automake --add-missing --copy

- name: Generate configure script
run: autoconf

- name: Run configure script
run: ./configure

- name: Build
run: make

- name: Check
run: make check

- name: Distcheck
run: make distcheck
14 changes: 14 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
AUTOMAKE_OPTIONS = foreign subdir-objects

# Define the subdirectories
SUBDIRS = include src

# Include directories
AM_CPPFLAGS = -I$(srcdir)/include

# Define the program to be built
bin_PROGRAMS = main

# Additional flags and libraries
main_CXXFLAGS = -Wall -g $(AM_CPPFLAGS)
main_LDADD = -lm
19 changes: 19 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
AC_PREREQ([2.69])
AC_INIT([casamonitor], [1.0], [[email protected]])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AC_PROG_CC
AC_PROG_CXX

# Check for avr-gcc and avr-g++
AC_CHECK_TOOL([AVR_CC], [avr-gcc])
AC_CHECK_TOOL([AVR_CXX], [avr-g++])

# Set environment variables for AVR
AC_SUBST([CC], [$AVR_CC])
AC_SUBST([CXX], [$AVR_CXX])
AC_SUBST([CFLAGS], ['-mmcu=atmega328p -Os'])
AC_SUBST([CXXFLAGS], ['-mmcu=atmega328p -Os'])
AC_SUBST([LDFLAGS], ['-mmcu=atmega328p'])

AC_CONFIG_FILES([Makefile include/Makefile src/Makefile])
AC_OUTPUT
1 change: 1 addition & 0 deletions include/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Makefile.am for the include directory
9 changes: 9 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# src/Makefile.am

# Define the source files for the executable
main_SOURCES = \
buff_atomic.cpp \
main.cpp \
timers.cpp \
uint8t.c \
usart.c

0 comments on commit 7af8bb6

Please sign in to comment.