1# Appended stuff starts here 2# 3 4 5# C++ flags: 6CPPFLAGS = -D__cplusplus -Dc_plusplus 7 8 9# Source files list: 10include Makefile.srclist 11 12 13# Compiler set up: 14BIN = SearchAndRescue 15OBJ_C = $(SRC_C:.c=.o) 16OBJ_CPP = $(SRC_CPP:.cpp=.o) 17.c.o: 18 @echo "Compiling module $*.o" 19 @$(CC) -c $*.c $(INC_DIRS) $(CFLAGS) 20.cpp.o: 21 @echo "Compiling module $*.o" 22 @$(CPP) -c $*.cpp $(INC_DIRS) $(CFLAGS) $(CPPFLAGS) 23 24# Programs 25LS = ls 26LSFLAGS = -s -h -c --color=auto 27RM = rm 28RMFLAGS = -f 29 30# Build rules: 31$(BIN): prebuild modules postbuild 32 33modules: $(OBJ_C) $(OBJ_CPP) 34 @echo -n "Linking modules..." 35 @$(CPP) $(OBJ_C) $(OBJ_CPP) -o $(BIN) $(LIBS) $(LIB_DIRS) 36 @echo -n " " 37 @-$(LS) $(LSFLAGS) $(BIN) 38 39prebuild: 40 @echo "Building program \"$(BIN)\"..." 41 42postbuild: 43 @echo "Build done." 44 @echo "To install, type \"su\" (to gain root privileges) and then type \"make install\"." 45 46all: $(BIN) 47 48 49# Install Rules: 50include Makefile.install.UNIX 51 52 53# Maintainance and Misc Rules: 54clean: 55 @echo "Cleaning program \"$(BIN)\"..." 56 @echo "Deleting all intermediate files..." 57 @$(RM) $(RMFLAGS) a.out core *.o $(BIN) 58 @echo "Clean done." 59