| 1234567891011121314151617 |
- CC = gcc
- CFLAGS = -Wall -g
- # test2.o: test2.c
- # $(CC) $(CFLAGS) -c test2.c -o test2.o
- # test1.o: test1.c
- # $(CC) $(CFLAGS) -c test1.c -o test1.o
- %.o: %.c
- $(CC) $(CFLAGS) -c $^ -o $@
- objfiles = test1.o test2.o
- test: $(objfiles)
- $(CC) $(CFLAGS) $^ -o $@
- all: test
- @echo "Build complete"
- .PHONY: clean
- clean:
- rm -f test1.o test2.o test
|