lc3-vm/Makefile
2023-08-10 18:21:56 -05:00

19 lines
588 B
Makefile

CC = gcc
CFLAGS = -Wall -std=c99 -g
LDFLAGS =
TARGET = lc3
$(TARGET): target/obj/main.o target/obj/ops.o target/obj/traps.o
$(CC) -o target/bin/$(TARGET) target/obj/main.o target/obj/ops.o target/obj/traps.o $(LDFLAGS)
target/obj/main.o: src/main.c src/main.h src/ops.h src/traps.h
$(CC) $(CFLAGS) -o target/obj/main.o -c src/main.c
target/obj/ops.o: src/ops.c src/main.h src/ops.h
$(CC) $(CFLAGS) -o target/obj/ops.o -c src/ops.c
target/obj/traps.o: src/traps.c src/main.h src/traps.h
$(CC) $(CFLAGS) -o target/obj/traps.o -c src/traps.c
run: $(TARGET)
./target/bin/$(TARGET)