I just come across Makefile built in rule to compile symbolic file.
SRCS = a.c $(LINKED_SRCS)
endif
# ++ linked source
LINKED_SRCS= b.c
${LINKED_SRCS} links: linkstamp
cleanlinks:
@ - rm -f ${LINKED_SRCS} linkstamp
linkstamp:
@ - rm -f ${LINKED_SRCS}
ln -sf $(PROJECTDIR)/SRC/UsrLib_src/b.c b.c
touch linkstamp
- This rule works, based on your linkstamp file, say if linkstamp file present - Makefile consider that symbolic link already presence.
-This rule will be executed before compiling b.c
-since b.c has links attached -- so b.c will not be compiled before link creation
step:1 -- compile a.c
step:2 -- create links
step 3: -- compile b.c
very interesting about links:
SRCS = a.c $(LINKED_SRCS)
endif
# ++ linked source
LINKED_SRCS= b.c
${LINKED_SRCS} links: linkstamp
cleanlinks:
@ - rm -f ${LINKED_SRCS} linkstamp
linkstamp:
@ - rm -f ${LINKED_SRCS}
ln -sf $(PROJECTDIR)/SRC/UsrLib_src/b.c b.c
touch linkstamp
- This rule works, based on your linkstamp file, say if linkstamp file present - Makefile consider that symbolic link already presence.
-This rule will be executed before compiling b.c
-since b.c has links attached -- so b.c will not be compiled before link creation
step:1 -- compile a.c
step:2 -- create links
step 3: -- compile b.c
very interesting about links:
No comments:
Post a Comment