CXX=g++ CXXFLAGS= LDFLAGS= LD=g++ AR = ar vru all: main-s main-d .SUFFIXES: .cc .o .cc.o: $(CXX) $(CXXFLAGS) -c $< main-s: main.o libmydso.a $(LD) $(LDFLAGS) -o $@ main.o libmydso.a main-d: libmydso.so main.o $(LD) $(LDFLAGS) -Wl,-rpath,. -o $@ main.o -L. -lmydso libmydso.so: dso.o $(LD) -Wl,-rpath,. -shared -all -g $(LDFLAGS) -o $@ dso.o libmydso.a: dso.o $(AR) $@ dso.o libmydso2.so: libmydso.a ld -mips3 -n32 -rpath . -elf -shared -no_unresolved -rdata_shared -all -o $@ libmydso.a main-dd: libmydso2.so main.o $(LD) $(LDFLAGS) -Wl,-rpath,. -o $@ main.o -L. -lmydso2 test: main-d main-s main-dd ./main-d ./main-s ./main-dd