i'm new to Makefile
. I've to write a Makefile to build a shared libary.
CC =g++
CFLAGS =-fPIC -Wall -Wextra -c
LDFLAGS =-shared
RM =rm -rf
TARGET_LIB =lib/Automat.so
SRC_DIR =src/
LIB_DIR =lib/
DEP_DIR =dep/
SRCS=IFSM.h IState.h ITransition.h FSM.h State.h Transition.h Wildcard.h PrimeTransition.h SingleTransition.h Exception.h Type.h Error.h
OBJS=$(SRCS:.h=.o)
.PHONY: all
all: $(TARGET_LIB)
$(TARGET_LIB): $(SRC_DIR)$(OBJS)
$(CC) $(LDFLAGS) -o $@ $^
$(SRC_DIR)$(SRCS:.h=.d):%.d:$(SRC_DIR)%.h
$(CC) $(CFLAGS) -MM $< > $(DEP_DIR)$@
include $(SRCS:.h=.d)
My problem is that i get the error
No rule to make target `IFSM.d'. Stop.
If i remove to file from SRCS
the problem occurs with IState.d
. All other .d files where builded correct (11 of 12).
All files exists and they are written correct (case-sensitiv).
I rly don't know where the error could be and i was searching for 2 hours now.
Any help would be great.
Best regards Alex