Create a single build that builds everything
This commit is contained in:
parent
c34886bad5
commit
6787d7484e
32
flake.nix
32
flake.nix
|
@ -9,8 +9,20 @@
|
|||
let
|
||||
version = builtins.string 0 8 self.lastModifiedDate;
|
||||
supportedSystems = [ "x86_64-linux" "avr-none" ];
|
||||
in
|
||||
in rec
|
||||
{
|
||||
defaultPackage."x86_64-linux" =
|
||||
let
|
||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||
in pkgs.symlinkJoin {
|
||||
name = "avr-monorepo";
|
||||
paths = [
|
||||
packages."x86_64-linux"."flame"
|
||||
packages."x86_64-linux"."prime-tx"
|
||||
packages."x86_64-linux"."radio-rx"
|
||||
];
|
||||
};
|
||||
|
||||
packages."x86_64-linux"."flame" =
|
||||
let
|
||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||
|
@ -28,12 +40,12 @@
|
|||
${avr.gcc}/bin/avr-gcc ${CFLAGS} -I${src}/base -o base.o -c ${src}/base/base.c
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} -I${src}/base -o sk9822.o -c ${src}/sk9822/sk9822.c
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} -I${src}/base -I${src}/sk9822 -o main.o -c ${src}/flame/main.c
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} -o main.elf main.o sk9822.o base.o
|
||||
$OBJCOPY -O ihex main.elf main.hex
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} -o flame.elf main.o sk9822.o base.o
|
||||
$OBJCOPY -O ihex flame.elf flame.hex
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp main.elf main.hex $out
|
||||
cp flame.elf flame.hex $out
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -60,12 +72,12 @@
|
|||
${avr.gcc}/bin/avr-gcc ${CFLAGS} ${INCLUDE_DIRS} -o reg.o -c ${src}/shift_register/shift_register.c
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} ${INCLUDE_DIRS} -o display.o -c ${src}/display/display.c
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} ${INCLUDE_DIRS} -o main.o -c ${src}/prime-tx/main.c
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} -o main.elf main.o display.o spi.o rfm.o reg.o
|
||||
$OBJCOPY -O ihex main.elf main.hex
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} -o prime-tx.elf main.o display.o spi.o rfm.o reg.o
|
||||
$OBJCOPY -O ihex prime-tx.elf prime-tx.hex
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp main.elf main.hex $out
|
||||
cp prime-tx.elf prime-tx.hex $out
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -92,12 +104,12 @@
|
|||
${avr.gcc}/bin/avr-gcc ${CFLAGS} ${INCLUDE_DIRS} -o reg.o -c ${src}/shift_register/shift_register.c
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} ${INCLUDE_DIRS} -o display.o -c ${src}/display/display.c
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} ${INCLUDE_DIRS} -o main.o -c ${src}/radio-rx/main.c
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} -o main.elf main.o display.o spi.o rfm.o reg.o
|
||||
$OBJCOPY -O ihex main.elf main.hex
|
||||
${avr.gcc}/bin/avr-gcc ${CFLAGS} -o radio-rx.elf main.o display.o spi.o rfm.o reg.o
|
||||
$OBJCOPY -O ihex radio-rx.elf radio-rx.hex
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp main.elf main.hex $out
|
||||
cp radio-rx.elf radio-rx.hex $out
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue