aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 15 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 6057c1f..54338b6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,17 @@
-CC := gcc -DFOCI_X86_64
-#CC := arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -DFOCI_ARM
-#CC := msp430-elf-gcc -DFOCI_MSP430 -mmcu=msp430g2553
-CFLAGS := -O3 -ggdb -g3 -Wall -Wextra
+CFLAGS := -O3 -ggdb -g3 -Wall -Wextra -I.
-all: foci
- $(CC) $(CFLAGS) main.c foci.o -o main
+all: x86-64
-foci:
- $(CC) $(CFLAGS) -c foci.c
+clean:
+ rm -f main foci.o
+
+x86-64: CC := gcc -DFOCI_X86_64
+x86-64: x86/main.c foci.o
+ $(CC) $(CFLAGS) $^ -o main
+
+arm-cm4: CC := arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -DFOCI_ARM
+arm-cm4: foci.o
+
+msp430: CC := msp430-elf-gcc -DFOCI_MSP430 -mmcu=msp430g2553
+msp430: msp430/main.c foci.o
+ $(CC) $(CFLAGS) -Lmsp430 $^ -o main