12345678910111213141516171819202122232425262728293031323334353637 |
- .POSIX: ;
- .SILENT: ;
- include config.mk
- NAME = map1
- OBJS = src/main.o
- default: flags bin/${NAME}
- all: flags bin/${NAME}
- flags:
- @echo ${NAME} 'build options:'
- @echo 'CC =' ${CC}
- @echo 'CPPFLAGS =' ${CPPFLAGS}
- @echo 'CFLAGS =' ${CFLAGS}
- @echo 'LDFLAGS =' ${LDFLAGS}
- ${OBJS}: config.mk Makefile
- .c.o:
- @echo compiling $<
- ${CC} ${CFLAGS} ${CPPFLAGS} -c $< -o $@
- bin/${NAME}: ${OBJS}
- @echo linking $@
- ${CC} ${CFLAGS} ${LDFLAGS} ${OBJS} -o $@
- clean:
- @echo cleaning
- rm -r src/*.o bin/${NAME}
- fresh: clean flags all
- .PHONY: default all flags clean fresh
|