CC=gcc -fPIC -g CFLAGS= -c -Wall LDFLAGS= #defined global variables and programs to build include Makefile.conf PCIE40_DYN_LIB=../Pcie40DriverLibraries PCIE40_INC_DIR=../Pcie40DriverLibraries OBJ_DIR=obj/ INC_DIR=inc/ LIB_DIR=lib/ #Files ------------------------------------------------------------------------ #ECS ECS_SRC= pcie40_ecs.c ECS_OBJ=$(ECS_SRC:%.c=$(OBJ_DIR)%.o) #Minipods MINIPODS_SRC= i2cDriver.c MINIPODS_OBJ=$(MINIPODS_SRC:%.c=$(OBJ_DIR)%.o) #LTC2990 LTC2990_SRC= LTC2990_OBJ=$(LTC2990_SRC:$(SRC_DIR)$(LTC2990_DIR)%.c=$(OBJ_DIR)%.o) # static libraries ECS_LIB= libecs.a MINIPODS_LIB= libminipods.a LTC2990_LIB= libltc2990.a # dynamic libraries LLI_DYNLIB= libpcie40.so all: $(ECS_OBJ) $(ECS_LIB) $(MINIPODS_OBJ) $(MINIPODS_LIB) $(LTC2990_OBJ) $(LTC2990_LIB) $(LLI_DYNLIB) $(ECS_OBJ): $(OBJ_DIR)%.o : %.c @echo "Construction of ecs objects $@ from $<" mkdir -p obj $(CC) $(CFLAGS) -I . -I $(PCIE40_INC_DIR) $< -o $@ $(ECS_LIB) : $(ECS_OBJ) @echo "Construction of ECS Library" mkdir -p lib ar -q $(LIB_DIR)$(ECS_LIB) $(ECS_OBJ) @echo "" $(MINIPODS_OBJ): $(OBJ_DIR)%.o : $(SRC_DIR)%.c @echo "Construction of $@ from $<" $(CC) $(CFLAGS) -I . -I $(INC_DIR)$(SYSTEM_DIR) -I $(PCIE40_INC_DIR) $< -o $@ @echo "" $(MINIPODS_LIB) : $(MINIPODS_OBJ) @echo "Construction of MINIPODS Library" ar -q $(LIB_DIR)$(MINIPODS_LIB) $(MINIPODS_OBJ) @echo "" $(LTC2990_OBJ): $(OBJ_DIR)%.o : $(SRC_DIR)$(LTC2990_DIR)%.c @echo "Construction of $@ from $<" $(CC) $(CFLAGS) -I $(INC_DIR)$(PLL_DIR) -I $(INC_DIR)$(LTC2990_DIR) -I $(INC_DIR)$(SYSTEM_DIR) -I $(INC_DIR)$(MINIPODS_DIR) -I $(INC_DIR)$(LTC2990_DIR) -I $(PCIE40_INC_DIR) $< -o $@ @echo "" $(LTC2990_LIB) : $(LTC2990_OBJ) @echo "Construction of LTC2990 Library" ar -q $(LIB_DIR)$(LTC2990_LIB) $(LTC2990_OBJ) @echo "" $(LLI_DYNLIB) : $(ECS_OBJ) $(MINIPODS_OBJ) @echo "Construction of dynamic LLI technical Library for V2" mkdir -p lib $(CC) -o $(LIB_DIR)$(LLI_DYNLIB) -shared $(ECS_OBJ) $(PLL_OBJ) $(MINIPODS_OBJ) -L $(PCIE40_DYN_LIB) -lpcie40driver_ecs @echo clean: mrproper @echo "removing lli objects" -rm $(OBJ_DIR)*.o @echo "" @echo "removing $(ECS_LIB)" -rm $(LIB_DIR)$(ECS_LIB) @echo "" @echo "removing $(MINIPODS_LIB)" -rm $(LIB_DIR)$(MINIPODS_LIB) @echo "" @echo "removing $(LTC2990_LIB)" -rm $(LIB_DIR)$(LTC2990_LIB) @echo "" -rm $(LIB_DIR)$(LLI_DYNLIB) -rm -r $(LIB_DIR) @echo "" mrproper: @echo "Removing all *~ files" -find . -name "*~" -exec rm {} \; @echo ""