makefile generated by mgen
This commit is contained in:
parent
42b2e0b84e
commit
73c98d7ff4
2 changed files with 18 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1 @@
|
|||
target
|
||||
tutorial
|
||||
|
|
30
Makefile
30
Makefile
|
@ -1,19 +1,25 @@
|
|||
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)
|
||||
#=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/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
|
||||
@printf ':: Building ops.o ... '
|
||||
@$(CC) $(CFLAGS) -o target/obj/ops.o -c ./src/ops.c
|
||||
@printf 'done\n'
|
||||
|
||||
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/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/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)
|
||||
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=#
|
||||
|
|
Loading…
Reference in a new issue