![]() |
|
[Shell] [Makefile] No rule to make target... - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Shell] [Makefile] No rule to make target... (/showthread.php?tid=5767566) |
[Makefile] No rule to make target... - misterfail88 - Dec 13, 2017 Hi, I have a problem with Makefile. He which should compile .c file to an object file only if a .c file has been modified. But i have an error when i use "all" rule : Code make: *** No rule to make target `obj/main.o', needed by `ft_ls'. Stop.When i use manually it's works : Code clang -Wall -Wextra -Werror -Iinclude -o obj/main.o -c src/main.cMy work directory : Code Makefile include/*.h libft/libft.a src/*.cMakefile content : Code NAME = ft_lsIf you have some idea i'll take it 😁 Thx '/' missing $(OBJ_PATH)%.o: $(SRC_PATH)%.c ==> $(OBJ_PATH)/%.o: $(SRC_PATH)/%.c RE: [Makefile] No rule to make target... - HFDone - Dec 13, 2017 add directory for obj/main.o RE: [Makefile] No rule to make target... - misterfail88 - Dec 13, 2017 (Dec 13, 2017 08:43 AM)HFDone Wrote: add directory for obj/main.o Directory will be create automatically. But my problem is solved : '/' missing $(OBJ_PATH)%.o: $(SRC_PATH)%.c ==> $(OBJ_PATH)/%.o: $(SRC_PATH)/%.c |