lc3-vm/Makefile

25 lines
813 B
Makefile

CC = gcc
CFLAGS = -Wall -std=c99 -g
TARGET = lc3
#=mgen_start=#
target/$(TARGET): target/obj/ops.o target/obj/traps.o target/obj/main.o
@printf ':: Linking %s ... ' $(TARGET)
@$(CC) $(LDFLAGS) -o target/$(TARGET) target/obj/ops.o target/obj/traps.o target/obj/main.o $(LDLIBS)
@printf 'done\n'
target/obj/ops.o: ./src/ops.c ./src/main.h
@printf ':: Building ops.o ... '
@$(CC) $(CFLAGS) -o target/obj/ops.o -c ./src/ops.c
@printf 'done\n'
target/obj/traps.o: ./src/traps.c ./src/traps.h ./src/main.h
@printf ':: Building traps.o ... '
@$(CC) $(CFLAGS) -o target/obj/traps.o -c ./src/traps.c
@printf 'done\n'
target/obj/main.o: ./src/main.c ./src/main.h ./src/ops.h ./src/traps.h
@printf ':: Building main.o ... '
@$(CC) $(CFLAGS) -o target/obj/main.o -c ./src/main.c
@printf 'done\n'
#=mgen_end=#